diff options
author | Dominik Ritter <dominik.ritter@pixelhouse.de> | 2015-03-29 19:26:02 +0300 |
---|---|---|
committer | Dominik Ritter <dominik.ritter@pixelhouse.de> | 2015-03-29 19:26:02 +0300 |
commit | 1f3c8e4d775dccb353d56a7bad3da4b99ca51707 (patch) | |
tree | c568b73057da51eb1508d6b93bf623bacb4e8392 /powerlevel9k.zsh-theme | |
parent | f1518de92fd58f437fbb9fe37ca30452b2207125 (diff) |
Bugfix: we have to reset the dirty-state once we visited a dirty working copy.
And a bit of formatting.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r-- | powerlevel9k.zsh-theme | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 00271a08..4a6f5655 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -103,7 +103,7 @@ prompt_context() { fi } -# Git: branch/detached head, dirty status +# branch/detached head, dirty status prompt_vcs() { local vcs_prompt="${vcs_info_msg_0_}" @@ -168,9 +168,11 @@ function +vi-git-tagname() { } function +vi-vcs-detect-changes() { - if [[ -n ${hook_com[staged]} ]] || [[ -n ${hook_com[unstaged]} ]]; then - VCS_WORKDIR_DIRTY=true - fi + if [[ -n ${hook_com[staged]} ]] || [[ -n ${hook_com[unstaged]} ]]; then + VCS_WORKDIR_DIRTY=true + else + VCS_WORKDIR_DIRTY=false + fi } # Dir: current working directory @@ -268,9 +270,9 @@ build_right_prompt() { # Create the prompts precmd() { - vcs_info - # Add a static hook to examine staged/unstaged changes. - vcs_info_hookadd set-message vcs-detect-changes + vcs_info + # Add a static hook to examine staged/unstaged changes. + vcs_info_hookadd set-message vcs-detect-changes } PROMPT='%{%f%b%k%}$(build_left_prompt) ' |