mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
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:
parent
53a2484fd1
commit
a004a10a80
1 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue