summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Bianchi <sbooob@gmail.com>2013-03-26 09:57:11 +0100
committerYohann Bianchi <sbooob@gmail.com>2013-03-26 09:57:11 +0100
commit5128669a76a744883ad51df7682577e6654418e1 (patch)
treee6c1010deeb7a388133298903883502148d9a5fa
parent5eb3ec6428809fcf02d724f913201abbd04a88a6 (diff)
downloadzsh-5128669a76a744883ad51df7682577e6654418e1.tar.gz
zsh-5128669a76a744883ad51df7682577e6654418e1.tar.bz2
zsh-5128669a76a744883ad51df7682577e6654418e1.zip
IMPROVED: untracked file status has priority over modified (ie: if you have both modified and untracked files, your prompt will be red indicating the presence of untracked files)
-rw-r--r--themes/agnoster.zsh-theme5
1 files changed, 2 insertions, 3 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index e2074b713..75e095776 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -87,12 +87,11 @@ prompt_hg() {
local rev status
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
- st=$(hg prompt {status})
- if [[ $st = "?" ]]; then
+ if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
# if files are not added
prompt_segment red white
st='±'
- elif [[ -n $st ]]; then
+ elif [[ -n $(hg prompt "{status|modified}") ]]; then
# if any modification
prompt_segment yellow black
st='±'