1
0
Fork 0
mirror of synced 2024-11-03 00:18:57 -04:00

Only evaluate prompt_gitster_status once

replacing its contents directly into the `PROMPT`, instead of calling
the function continuously.
This commit is contained in:
Eric Nielsen 2017-03-10 13:49:59 -05:00
parent 4b95df9a5f
commit fbe108f5f3

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=''
}