From 21b8b332435887aa9378ed50f86b2eb8dbf19fb3 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Wed, 15 Jun 2022 15:25:13 -0700 Subject: [PATCH] Remove restart option from first config menu --- .../tide/configure/choices/all/style.fish | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/functions/tide/configure/choices/all/style.fish b/functions/tide/configure/choices/all/style.fish index ff3d5d2..ae52bc5 100644 --- a/functions/tide/configure/choices/all/style.fish +++ b/functions/tide/configure/choices/all/style.fish @@ -13,7 +13,7 @@ function style _load_config rainbow _tide_display_prompt - _tide_menu + _tide_style_menu switch $_tide_selected_option case 1 _load_config lean @@ -31,3 +31,27 @@ end function _load_config -a name string replace -r '^' 'set -g fake_' <(status dirname)/../../configs/$name.fish | source end + +function _tide_style_menu # Exactly like _tide_menu except that it doesn't have (r) option + set -l list_with_slashes (string join '/' $_tide_option_list) + + echo '(q) Quit and do nothing'\n + + while true + set_color -o + read --nchars 1 --prompt-str "Choice [$list_with_slashes/q] " input + set_color normal + + switch $input + case q + set -e _tide_selected_option # Skip through all the _next_choices + set -e _tide_option_list + command -q clear && clear + break + case $_tide_option_list + set -e _tide_option_list + set -g _tide_selected_option $input + break + end + end +end