X-Git-Url: https://git.madduck.net/etc/git.git/blobdiff_plain/821d3028f391ed1659186b68659d902dd0a2713e..552942f8982b70d66ac6c2f4ad9426801e388289:/.zsh/zshrc/parts.d/50-git?ds=inline 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