1
0
Fork 0
mirror of synced 2024-11-23 07:45:34 -05:00

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

View file

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