mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
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)
This commit is contained in:
parent
5eb3ec6428
commit
5128669a76
1 changed files with 2 additions and 3 deletions
|
@ -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='±'
|
||||
|
|
Loading…
Reference in a new issue