X-Git-Url: https://git.madduck.net/etc/git.git/blobdiff_plain/a0d7ac1318b3019819e7f2108a924319439c5a39..refs/heads/master:/.zsh/zshrc/parts.d/50-git diff --git a/.zsh/zshrc/parts.d/50-git b/.zsh/zshrc/parts.d/50-git index da11bf8..9419e15 100644 --- a/.zsh/zshrc/parts.d/50-git +++ b/.zsh/zshrc/parts.d/50-git @@ -60,6 +60,13 @@ __git_set_prompt_variable() { add-zsh-hook chpwd __git_set_prompt_variable __git_set_prompt_variable +__update_git_prompt_vars_if_git_ran() { + case "$(history $(($HISTCMD - 1)))" in + *git*) __git_set_prompt_variable + esac +} +add-zsh-hook precmd __update_git_prompt_vars_if_git_ran + __git_print_preprompt() { [[ $? -eq 0 ]] || return