aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorMartin Pelikan <martin.pel@gmail.com>2015-07-07 06:56:02 +0300
committerMartin Pelikan <martin.pel@gmail.com>2015-07-08 05:53:11 +0300
commit5a9695dcd4e1900b92a7ec84cf2ed0dd105aa1a8 (patch)
treefc0a38315cbfd7f20de47a66bf281019eb4e2ed9 /powerlevel9k.zsh-theme
parent558d137bfaf3b64c5e1b6b1091b0c066cb5f5cce (diff)
Correctly set VCS dirty status on first invocation.
The precmd hook seems to not get called on first invocation, and gets called recursively for every subsequent invocation.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme12
1 files changed, 3 insertions, 9 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 1ebc31bb..52cfa96d 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -221,7 +221,8 @@ zstyle ':vcs_info:*' actionformats " %b %F{red}| %a%f"
zstyle ':vcs_info:*' stagedstr " %F{$VCS_FOREGROUND_COLOR}$VCS_STAGED_ICON%f"
zstyle ':vcs_info:*' unstagedstr " %F{$VCS_FOREGROUND_COLOR}$VCS_UNSTAGED_ICON%f"
-zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-aheadbehind git-stash git-remotebranch git-tagname
+zstyle ':vcs_info:git*+set-message:*' hooks vcs-detect-changes git-untracked git-aheadbehind git-stash git-remotebranch git-tagname
+zstyle ':vcs_info:hg*+set-message:*' hooks vcs-detect-changes
# For Hg, only show the branch name
zstyle ':vcs_info:hg*:*' branchformat "$VCS_BRANCH_ICON%b"
@@ -575,13 +576,6 @@ build_right_prompt() {
done
}
-prompt_powerlevel9k_precmd() {
- vcs_info
-
- # Add a static hook to examine staged/unstaged changes.
- vcs_info_hookadd set-message vcs-detect-changes
-}
-
powerlevel9k_init() {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
@@ -593,7 +587,7 @@ powerlevel9k_init() {
# initialize VCS
autoload -Uz add-zsh-hook
- add-zsh-hook precmd prompt_powerlevel9k_precmd
+ add-zsh-hook precmd vcs_info
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
PROMPT="╭─%{%f%b%k%}"'$(build_left_prompt)'"