mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
git_prompt: Allow all set_color arguments
There is no need to explicitly check for two arguments and set --bold. Instead the user can simply "set __fish_git_prompt_color_flags --bold red". The current check violates the expectation set by the documentation that you can use any set_color argument as the current code interprets "--bold red" as "--bold --bold" instead. Plus, by passing the full contents of the variable directly, the user can do more adventurous things like set the background as well.
This commit is contained in:
parent
137463dc6d
commit
59dd6678c3
1 changed files with 1 additions and 10 deletions
|
@ -672,21 +672,12 @@ function __fish_git_prompt_set_color
|
|||
set default_done "$argv[3]"
|
||||
end
|
||||
|
||||
if test (count $user_variable) -eq 2
|
||||
set user_variable_bright $user_variable[2]
|
||||
set user_variable $user_variable[1]
|
||||
end
|
||||
|
||||
set -l variable _$user_variable_name
|
||||
set -l variable_done "$variable"_done
|
||||
|
||||
if not set -q $variable
|
||||
if test -n "$user_variable"
|
||||
if test -n "$user_variable_bright"
|
||||
set -g $variable (set_color --bold $user_variable)
|
||||
else
|
||||
set -g $variable (set_color $user_variable)
|
||||
end
|
||||
set -g $variable (set_color $user_variable)
|
||||
set -g $variable_done (set_color normal)
|
||||
else
|
||||
set -g $variable $default
|
||||
|
|
Loading…
Reference in a new issue