fish_git_prompt: Remove variables we don't care from event handler

This was called e.g. when showdirtystate was changed, but then checked
if it was called for the informative statusses only. Simply remove
them.
This commit is contained in:
Fabian Boehm 2022-06-21 20:22:27 +02:00
parent 53a2484fd1
commit a004a10a80

View file

@ -619,14 +619,12 @@ function __fish_git_prompt_validate_colors --description "fish_git_prompt helper
end
function __fish_git_prompt_reset -a type -a op -a var --description "Event handler, resets prompt when functionality changes" \
--on-variable=__fish_git_prompt_{repaint,describe_style,show_informative_status,use_informative_chars,showdirtystate,showstashstate,showuntrackedfiles,showupstream}
--on-variable=__fish_git_prompt_{show_informative_status,use_informative_chars}
if status --is-interactive
if contains -- $var __fish_git_prompt_show_informative_status __fish_git_prompt_use_informative_chars
# Clear characters that have different defaults with/without informative status
set -e ___fish_git_prompt_char_{name,cleanstate,dirtystate,invalidstate,stagedstate,stashstate,stateseparator,untrackedfiles,upstream_ahead,upstream_behind}
# Clear init so we reset the chars next time.
set -e ___fish_git_prompt_init
end
# Clear characters that have different defaults with/without informative status
set -e ___fish_git_prompt_char_{name,cleanstate,dirtystate,invalidstate,stagedstate,stashstate,stateseparator,untrackedfiles,upstream_ahead,upstream_behind}
# Clear init so we reset the chars next time.
set -e ___fish_git_prompt_init
end
end