From b88d77fb2d0d5028a6f5670695dee6bec129501f Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Fri, 5 Apr 2024 11:57:45 -0400 Subject: ahhh sloppy fish, still needs fixing, esp with the vars --- .../tide/configure/choices/all/finish.fish | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 home-config/fish/functions/tide/configure/choices/all/finish.fish (limited to 'home-config/fish/functions/tide/configure/choices/all/finish.fish') diff --git a/home-config/fish/functions/tide/configure/choices/all/finish.fish b/home-config/fish/functions/tide/configure/choices/all/finish.fish new file mode 100644 index 0000000..f670b1e --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/finish.fish @@ -0,0 +1,46 @@ +function finish + _tide_title Finish + + echo + set_color red + _tide_option y 'Overwrite your current tide config' + set_color normal + echo + + _tide_option p 'Exit and print the config you just generated' + echo + + _tide_menu (status function) + switch $_tide_selected_option + case 'Overwrite your current tide config' + _tide_finish + command -q clear && clear + set -q _flag_auto || _tide_print_configure_current_options + case 'Exit and print the config you just generated' + _tide_exit_configure + command -q clear && clear + _tide_print_configure_current_options + end +end + +function _tide_finish + _tide_exit_configure + + # Deal with prompt char/vi mode + contains character $fake_tide_left_prompt_items || set -p fake_tide_left_prompt_items vi_mode + + # Set the real variables + for fakeVar in (set --names | string match -r "^fake_tide.*") + set -U (string replace 'fake_' '' $fakeVar) $$fakeVar + end + + # Make sure old prompt won't display + set -e $_tide_prompt_var 2>/dev/null + + # Re-initialize the prompt + tide reload +end + +function _tide_print_configure_current_options + _tide_fish_colorize "tide configure --auto $_tide_configure_current_options" +end -- cgit v1.2.3