From bad52f9dbb72771d75409a78f1c41fe0cbe99cd3 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Fri, 22 Jan 2021 16:31:31 -0800 Subject: [PATCH] Simplify menus code --- functions/tide/configure/choices/all/icons.fish | 4 +--- .../choices/all/prompt_connection_andor_frame_color.fish | 5 +---- functions/tide/configure/choices/all/prompt_spacing.fish | 3 +-- functions/tide/configure/choices/all/show_time.fish | 6 ------ .../configure/choices/classic/classic_prompt_color.fish | 5 +---- .../choices/classic/classic_prompt_separators.fish | 5 +---- .../tide/configure/choices/lean/lean_prompt_connection.fish | 4 +--- .../choices/powerline/powerline_prompt_connection.fish | 4 +--- .../configure/choices/powerline/powerline_prompt_frame.fish | 5 +---- .../configure/choices/powerline/powerline_prompt_heads.fish | 5 +---- .../configure/choices/powerline/powerline_prompt_tails.fish | 6 +----- .../choices/rainbow/rainbow_prompt_separators.fish | 5 +---- 12 files changed, 11 insertions(+), 46 deletions(-) diff --git a/functions/tide/configure/choices/all/icons.fish b/functions/tide/configure/choices/all/icons.fish index 6d7ff61..2f19d2b 100644 --- a/functions/tide/configure/choices/all/icons.fish +++ b/functions/tide/configure/choices/all/icons.fish @@ -12,10 +12,8 @@ function icons switch $_tide_selected_option case 1 _disable_icons - _next_choice 'all/finish' - case 2 - _next_choice 'all/finish' end + _next_choice 'all/finish' end function _enable_icons diff --git a/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish b/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish index 0757955..0459569 100644 --- a/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish +++ b/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish @@ -39,17 +39,14 @@ function prompt_connection_andor_frame_color switch $_tide_selected_option case 1 _set_prompt_connection_and_frame_color 808080 - _next_choice 'all/prompt_spacing' case 2 _set_prompt_connection_and_frame_color 6C6C6C - _next_choice 'all/prompt_spacing' case 3 _set_prompt_connection_and_frame_color 585858 - _next_choice 'all/prompt_spacing' case 4 _set_prompt_connection_and_frame_color 444444 - _next_choice 'all/prompt_spacing' end + _next_choice 'all/prompt_spacing' end function _set_prompt_connection_and_frame_color -a color diff --git a/functions/tide/configure/choices/all/prompt_spacing.fish b/functions/tide/configure/choices/all/prompt_spacing.fish index 98fd7bc..43b4bbe 100644 --- a/functions/tide/configure/choices/all/prompt_spacing.fish +++ b/functions/tide/configure/choices/all/prompt_spacing.fish @@ -14,9 +14,8 @@ function prompt_spacing switch $_tide_selected_option case 1 set -g fake_tide_print_newline_before_prompt false - _next_choice 'all/icons' case 2 set -g fake_tide_print_newline_before_prompt true - _next_choice 'all/icons' end + _next_choice 'all/icons' end \ No newline at end of file diff --git a/functions/tide/configure/choices/all/show_time.fish b/functions/tide/configure/choices/all/show_time.fish index d337147..554b07e 100644 --- a/functions/tide/configure/choices/all/show_time.fish +++ b/functions/tide/configure/choices/all/show_time.fish @@ -17,17 +17,11 @@ function show_time case 1 set -g fake_tide_time_format '' set -e fake_tide_right_prompt_items[-1] - _show_time_next_choice case 2 set -g fake_tide_time_format '%T' - _show_time_next_choice case 3 set -g fake_tide_time_format '%r' - _show_time_next_choice end -end - -function _show_time_next_choice switch $_tide_configure_style case lean _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_height diff --git a/functions/tide/configure/choices/classic/classic_prompt_color.fish b/functions/tide/configure/choices/classic/classic_prompt_color.fish index e1198b8..359bc1c 100644 --- a/functions/tide/configure/choices/classic/classic_prompt_color.fish +++ b/functions/tide/configure/choices/classic/classic_prompt_color.fish @@ -21,17 +21,14 @@ function classic_prompt_color switch $_tide_selected_option case 1 _set_all_items_bg_color 585858 - _next_choice 'all/show_time' case 2 _set_all_items_bg_color 444444 - _next_choice 'all/show_time' case 3 _set_all_items_bg_color 303030 - _next_choice 'all/show_time' case 4 _set_all_items_bg_color 1C1C1C - _next_choice 'all/show_time' end + _next_choice 'all/show_time' end function _set_all_items_bg_color -a color diff --git a/functions/tide/configure/choices/classic/classic_prompt_separators.fish b/functions/tide/configure/choices/classic/classic_prompt_separators.fish index 61af2fa..eaf8cf7 100644 --- a/functions/tide/configure/choices/classic/classic_prompt_separators.fish +++ b/functions/tide/configure/choices/classic/classic_prompt_separators.fish @@ -26,18 +26,15 @@ function classic_prompt_separators case 1 set -g fake_tide_left_prompt_item_separator_same_color '' set -g fake_tide_right_prompt_item_separator_same_color '' - _next_choice 'powerline/powerline_prompt_heads' case 2 set -g fake_tide_left_prompt_item_separator_same_color '│' set -g fake_tide_right_prompt_item_separator_same_color '│' - _next_choice 'powerline/powerline_prompt_heads' case 3 set -g fake_tide_left_prompt_item_separator_same_color '╱' set -g fake_tide_right_prompt_item_separator_same_color '╱' - _next_choice 'powerline/powerline_prompt_heads' case 4 set -g fake_tide_left_prompt_item_separator_same_color '' set -g fake_tide_right_prompt_item_separator_same_color '' - _next_choice 'powerline/powerline_prompt_heads' end + _next_choice 'powerline/powerline_prompt_heads' end \ No newline at end of file diff --git a/functions/tide/configure/choices/lean/lean_prompt_connection.fish b/functions/tide/configure/choices/lean/lean_prompt_connection.fish index 3613497..0de91e3 100644 --- a/functions/tide/configure/choices/lean/lean_prompt_connection.fish +++ b/functions/tide/configure/choices/lean/lean_prompt_connection.fish @@ -14,12 +14,10 @@ function lean_prompt_connection switch $_tide_selected_option case 1 set -g fake_tide_prompt_connection_icon '' - _next_choice 'all/prompt_connection_andor_frame_color' case 2 set -g fake_tide_prompt_connection_icon '·' - _next_choice 'all/prompt_connection_andor_frame_color' case 3 set -g fake_tide_prompt_connection_icon '─' - _next_choice 'all/prompt_connection_andor_frame_color' end + _next_choice 'all/prompt_connection_andor_frame_color' end \ No newline at end of file diff --git a/functions/tide/configure/choices/powerline/powerline_prompt_connection.fish b/functions/tide/configure/choices/powerline/powerline_prompt_connection.fish index 724e9e8..9017a6a 100644 --- a/functions/tide/configure/choices/powerline/powerline_prompt_connection.fish +++ b/functions/tide/configure/choices/powerline/powerline_prompt_connection.fish @@ -14,12 +14,10 @@ function powerline_prompt_connection switch $_tide_selected_option case 1 set -g fake_tide_prompt_connection_icon '' - _next_choice 'powerline/powerline_prompt_frame' case 2 set -g fake_tide_prompt_connection_icon '·' - _next_choice 'powerline/powerline_prompt_frame' case 3 set -g fake_tide_prompt_connection_icon '─' - _next_choice 'powerline/powerline_prompt_frame' end + _next_choice 'powerline/powerline_prompt_frame' end \ No newline at end of file diff --git a/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish b/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish index 1d3fd05..a01eafb 100644 --- a/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish +++ b/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish @@ -31,19 +31,16 @@ function powerline_prompt_frame set fake_tide_left_prompt_frame_enabled false set fake_tide_right_prompt_frame_enabled false set -a fake_tide_left_prompt_items prompt_char - _next_choice 'all/prompt_connection_andor_frame_color' case 2 set fake_tide_left_prompt_frame_enabled true set fake_tide_right_prompt_frame_enabled false - _next_choice 'all/prompt_connection_andor_frame_color' case 3 set fake_tide_left_prompt_frame_enabled false set fake_tide_right_prompt_frame_enabled true set -a fake_tide_left_prompt_items prompt_char - _next_choice 'all/prompt_connection_andor_frame_color' case 4 set fake_tide_left_prompt_frame_enabled true set fake_tide_right_prompt_frame_enabled true - _next_choice 'all/prompt_connection_andor_frame_color' end + _next_choice 'all/prompt_connection_andor_frame_color' end \ No newline at end of file diff --git a/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish b/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish index 98dd1f8..49d3d91 100644 --- a/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish +++ b/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish @@ -26,18 +26,15 @@ function powerline_prompt_heads case 1 set -g fake_tide_left_prompt_suffix '' set -g fake_tide_right_prompt_prefix '' - _next_choice 'powerline/powerline_prompt_tails' case 2 set -g fake_tide_left_prompt_suffix '▓▒░' set -g fake_tide_right_prompt_prefix '░▒▓' - _next_choice 'powerline/powerline_prompt_tails' case 3 set -g fake_tide_left_prompt_suffix '' set -g fake_tide_right_prompt_prefix '' - _next_choice 'powerline/powerline_prompt_tails' case 4 set -g fake_tide_left_prompt_suffix '' set -g fake_tide_right_prompt_prefix '' - _next_choice 'powerline/powerline_prompt_tails' end + _next_choice 'powerline/powerline_prompt_tails' end \ No newline at end of file diff --git a/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish b/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish index 889a338..9bf5ba1 100644 --- a/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish +++ b/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish @@ -31,22 +31,18 @@ function powerline_prompt_tails case 1 set -g fake_tide_left_prompt_prefix '' set -g fake_tide_right_prompt_suffix '' - _next_choice 'powerline/powerline_prompt_height' case 2 set -g fake_tide_left_prompt_prefix '░▒▓' set -g fake_tide_right_prompt_suffix '▓▒░' - _next_choice 'powerline/powerline_prompt_height' case 3 set -g fake_tide_left_prompt_prefix '' set -g fake_tide_right_prompt_suffix '' - _next_choice 'powerline/powerline_prompt_height' case 4 set -g fake_tide_left_prompt_prefix '' set -g fake_tide_right_prompt_suffix '' - _next_choice 'powerline/powerline_prompt_height' case 5 set -g fake_tide_left_prompt_prefix '' set -g fake_tide_right_prompt_suffix '' - _next_choice 'powerline/powerline_prompt_height' end + _next_choice 'powerline/powerline_prompt_height' end \ No newline at end of file diff --git a/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish index ada942f..bf5396a 100644 --- a/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish +++ b/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish @@ -26,18 +26,15 @@ function rainbow_prompt_separators case 1 set -g fake_tide_left_prompt_item_separator_diff_color '' set -g fake_tide_right_prompt_item_separator_diff_color '' - _next_choice 'powerline/powerline_prompt_heads' case 2 set -g fake_tide_left_prompt_item_separator_diff_color '' set -g fake_tide_right_prompt_item_separator_diff_color '' - _next_choice 'powerline/powerline_prompt_heads' case 3 set -g fake_tide_left_prompt_item_separator_diff_color '' set -g fake_tide_right_prompt_item_separator_diff_color '' - _next_choice 'powerline/powerline_prompt_heads' case 4 set -g fake_tide_left_prompt_item_separator_diff_color '' set -g fake_tide_right_prompt_item_separator_diff_color '' - _next_choice 'powerline/powerline_prompt_heads' end + _next_choice 'powerline/powerline_prompt_heads' end \ No newline at end of file