summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-07-09 04:44:50 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-07-09 04:44:50 +0300
commit24d7ba584ae345a940d226b3a7f6cc3a10d2d431 (patch)
treefc0a38315cbfd7f20de47a66bf281019eb4e2ed9
parent558d137bfaf3b64c5e1b6b1091b0c066cb5f5cce (diff)
parent5a9695dcd4e1900b92a7ec84cf2ed0dd105aa1a8 (diff)
Merge pull request #43 from martinpelikan/master
Correctly set VCS dirty status on first invocation.
-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)'"