Fix color reset #144 and close #155.

This commit is contained in:
Jorge Bucaran 2016-03-06 20:29:05 +09:00
parent d57ad028e6
commit 9ae8cce31c
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30
7 changed files with 58 additions and 53 deletions

View file

@ -5,6 +5,10 @@
* Introduce set_color_custom function that prompts can define to customize *fish_color_* variables. The user current color palette is saved to $fisher_config/fish_colors and restored when the prompt is disabled #144. * Introduce set_color_custom function that prompts can define to customize *fish_color_* variables. The user current color palette is saved to $fisher_config/fish_colors and restored when the prompt is disabled #144.
* Fix bug where fisher_path_is_prompt was not picking up prompts that define its functions inside a functions directory. #155.
* Add test stubs for missing test cases. We'll get around those eventually.
## [1.1.0][v110] - 2016-03-02 ## [1.1.0][v110] - 2016-03-02
* Fix regression causing update to fail in some plugins. aa8a98a * Fix regression causing update to fail in some plugins. aa8a98a

View file

@ -25,29 +25,31 @@ function __fisher_config_color_reset
return return
end end
set -l IFS \n
read -laz fish_colors < $fisher_config/fish_colors read -laz fish_colors < $fisher_config/fish_colors
set -U fish_color_normal $fish_colors[1] set -U fish_color_normal (echo $fish_colors[1] | tr " " \n)
set -U fish_color_command $fish_colors[2] set -U fish_color_command (echo $fish_colors[2] | tr " " \n)
set -U fish_color_param $fish_colors[3] set -U fish_color_param (echo $fish_colors[3] | tr " " \n)
set -U fish_color_redirection $fish_colors[4] set -U fish_color_redirection (echo $fish_colors[4] | tr " " \n)
set -U fish_color_comment $fish_colors[5] set -U fish_color_comment (echo $fish_colors[5] | tr " " \n)
set -U fish_color_error $fish_colors[6] set -U fish_color_error (echo $fish_colors[6] | tr " " \n)
set -U fish_color_escape $fish_colors[7] set -U fish_color_escape (echo $fish_colors[7] | tr " " \n)
set -U fish_color_operator $fish_colors[8] set -U fish_color_operator (echo $fish_colors[8] | tr " " \n)
set -U fish_color_quote $fish_colors[9] set -U fish_color_quote (echo $fish_colors[9] | tr " " \n)
set -U fish_color_autosuggestion $fish_colors[10] set -U fish_color_autosuggestion (echo $fish_colors[10] | tr " " \n)
set -U fish_color_valid_path $fish_colors[11] set -U fish_color_valid_path (echo $fish_colors[11] | tr " " \n)
set -U fish_color_cwd $fish_colors[12] set -U fish_color_cwd (echo $fish_colors[12] | tr " " \n)
set -U fish_color_cwd_root $fish_colors[13] set -U fish_color_cwd_root (echo $fish_colors[13] | tr " " \n)
set -U fish_color_match $fish_colors[14] set -U fish_color_match (echo $fish_colors[14] | tr " " \n)
set -U fish_color_search_match $fish_colors[15] set -U fish_color_search_match (echo $fish_colors[15] | tr " " \n)
set -U fish_color_selection $fish_colors[16] set -U fish_color_selection (echo $fish_colors[16] | tr " " \n)
set -U fish_pager_color_prefix $fish_colors[17] set -U fish_pager_color_prefix (echo $fish_colors[17] | tr " " \n)
set -U fish_pager_color_completion $fish_colors[18] set -U fish_pager_color_completion (echo $fish_colors[18] | tr " " \n)
set -U fish_pager_color_description $fish_colors[19] set -U fish_pager_color_description (echo $fish_colors[19] | tr " " \n)
set -U fish_pager_color_progress $fish_colors[20] set -U fish_pager_color_progress (echo $fish_colors[20] | tr " " \n)
set -U fish_color_history_current $fish_colors[21] set -U fish_color_history_current (echo $fish_colors[21] | tr " " \n)
rm -f $fisher_config/fish_colors rm -f $fisher_config/fish_colors
end end

View file

@ -1,26 +1,26 @@
function __fisher_config_color_save function __fisher_config_color_save
if test ! -f "$fisher_config/fish_colors" if test ! -f "$fisher_config/fish_colors"
printf "%s\n" \ printf "%s\n" \
$fish_color_normal \ "$fish_color_normal" \
$fish_color_command \ "$fish_color_command" \
$fish_color_param \ "$fish_color_param" \
$fish_color_redirection \ "$fish_color_redirection" \
$fish_color_comment \ "$fish_color_comment" \
$fish_color_error \ "$fish_color_error" \
$fish_color_escape \ "$fish_color_escape" \
$fish_color_operator \ "$fish_color_operator" \
$fish_color_quote \ "$fish_color_quote" \
$fish_color_autosuggestion \ "$fish_color_autosuggestion" \
$fish_color_valid_path \ "$fish_color_valid_path" \
$fish_color_cwd \ "$fish_color_cwd" \
$fish_color_cwd_root \ "$fish_color_cwd_root" \
$fish_color_match \ "$fish_color_match" \
$fish_color_search_match \ "$fish_color_search_match" \
$fish_color_selection \ "$fish_color_selection" \
$fish_pager_color_prefix \ "$fish_pager_color_prefix" \
$fish_pager_color_completion \ "$fish_pager_color_completion" \
$fish_pager_color_description \ "$fish_pager_color_description" \
$fish_pager_color_progress \ "$fish_pager_color_progress" \
$fish_color_history_current > "$fisher_config/fish_colors" "$fish_color_history_current" > "$fisher_config/fish_colors"
end end
end end

View file

@ -1,3 +1,5 @@
function __fisher_path_is_prompt -a path function __fisher_path_is_prompt -a path
test -e $path/fish_prompt.fish -o -e $path/fish_right_prompt.fish test \
-e $path/fish_prompt.fish -o -e $path/fish_right_prompt.fish -o \
-e $path/functions/fish_prompt.fish -o -e $path/functions/fish_right_prompt.fish
end end

View file

@ -0,0 +1,3 @@
test "$TESTNAME - Todo"
-z ""
end

View file

@ -0,0 +1,3 @@
test "$TESTNAME - Todo"
-z ""
end

View file

@ -1,12 +1,3 @@
set -g path $DIRNAME/.t-$TESTNAME-(random)
function -S setup
end
function -S teardown
rm -rf $path
end
test "$TESTNAME - Update Git repo at path" test "$TESTNAME - Update Git repo at path"
-z "" -z ""
end end