aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_git_prompt.fish
diff options
context:
space:
mode:
authorGravatar Brian Gernhardt <brian@gernhardtsoftware.com>2013-10-21 12:34:22 -0400
committerGravatar Brian Gernhardt <brian@gernhardtsoftware.com>2013-10-21 12:36:42 -0400
commit59dd6678c3dff58f778494641682188f006dae88 (patch)
treec36f950108cf8b54497569043be50fd437cdad0a /share/functions/__fish_git_prompt.fish
parent137463dc6d356b16f2238ffa00da494a97bbbc05 (diff)
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.
Diffstat (limited to 'share/functions/__fish_git_prompt.fish')
-rw-r--r--share/functions/__fish_git_prompt.fish11
1 files changed, 1 insertions, 10 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish
index 026c20cb..e6647284 100644
--- a/share/functions/__fish_git_prompt.fish
+++ b/share/functions/__fish_git_prompt.fish
@@ -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