From 59dd6678c3dff58f778494641682188f006dae88 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Mon, 21 Oct 2013 12:34:22 -0400 Subject: [PATCH] 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. --- share/functions/__fish_git_prompt.fish | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 026c20cba..e66472846 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