Skip to content

Commit 870fb63

Browse files
committed
git dir color
1 parent 3b8ef97 commit 870fb63

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='xontrib-powerline',
12-
version='0.1.0',
12+
version='0.1.1',
1313
description='Powerline for Xonsh shell',
1414
long_description=open('README.md').read(),
1515
long_description_content_type="text/markdown",

xontrib/powerline.xsh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ $PL_COLORS = {
2020
"who": ("BLACK", "#666666"),
2121
"short_cwd": ("BLACK", "#50a0a0"),
2222
"cwd": ("#00adee", "WHITE"),
23+
"git_root": ("BLUE", "WHITE"),
24+
"git_sub_dir": ("WHITE", "WHITE"),
2325
"history": ("WHITE", "#333333"),
2426
"venv": ("BLACK", "INTENSE_GREEN"),
2527
} if 'PL_COLORS' not in ${...} else $PL_COLORS
28+
if 'git_root' not in $PL_COLORS:
29+
$PL_COLORS.update({"git_root": ("BLUE", "WHITE")})
30+
if 'git_sub_dir' not in $PL_COLORS:
31+
$PL_COLORS.update({"git_sub_dir": ("WHITE", "WHITE")})
2632

2733

2834
if ptk_shell_type() == 'prompt_toolkit2':
@@ -89,7 +95,7 @@ def cwd():
8995
break
9096
ni -= 1
9197
if ni != 0: # if ni ==0 subdirectory matching failed
92-
ps[ni] = '{BLUE}%s{WHITE}' % ps[ni]
98+
ps[ni] = '{%s}%s{%s}' % ($PL_COLORS["git_root"][0], ps[ni], $PL_COLORS["git_sub_dir"][0])
9399

94100
if len(ps) > $PL_PARTS:
95101
new_ps = [ps[0]]

0 commit comments

Comments
 (0)