Only evaluate prompt_gitster_status once

replacing its contents directly into the `PROMPT`, instead of calling
the function continuously.

Closes #150
This commit is contained in:
Eric Nielsen 2017-03-10 13:49:59 -05:00 committed by Matt Hamilton
parent c7b2232378
commit 76cf486d5d
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@
# Requires the `git-info` zmodule to be included in the .zimrc file.
prompt_gitster_status() {
print -n '%(?:%F{green}:%F{red}) '
print -n '%(?:%F{green}:%F{red}) '
}
prompt_gitster_pwd() {
@ -37,7 +37,7 @@ prompt_gitster_setup() {
zstyle ':zim:git-info:keys' format \
'prompt' ' %F{cyan}%b%c %C%D'
PROMPT='$(prompt_gitster_status)$(prompt_gitster_pwd)$(prompt_gitster_git)%f '
PROMPT="$(prompt_gitster_status)\$(prompt_gitster_pwd)\$(prompt_gitster_git)%f "
RPROMPT=''
}