summaryrefslogtreecommitdiff
path: root/home-config/fish/functions/tide/configure/choices/all/finish.fish
diff options
context:
space:
mode:
Diffstat (limited to 'home-config/fish/functions/tide/configure/choices/all/finish.fish')
-rw-r--r--home-config/fish/functions/tide/configure/choices/all/finish.fish46
1 files changed, 46 insertions, 0 deletions
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 @@
1function finish
2 _tide_title Finish
3
4 echo
5 set_color red
6 _tide_option y 'Overwrite your current tide config'
7 set_color normal
8 echo
9
10 _tide_option p 'Exit and print the config you just generated'
11 echo
12
13 _tide_menu (status function)
14 switch $_tide_selected_option
15 case 'Overwrite your current tide config'
16 _tide_finish
17 command -q clear && clear
18 set -q _flag_auto || _tide_print_configure_current_options
19 case 'Exit and print the config you just generated'
20 _tide_exit_configure
21 command -q clear && clear
22 _tide_print_configure_current_options
23 end
24end
25
26function _tide_finish
27 _tide_exit_configure
28
29 # Deal with prompt char/vi mode
30 contains character $fake_tide_left_prompt_items || set -p fake_tide_left_prompt_items vi_mode
31
32 # Set the real variables
33 for fakeVar in (set --names | string match -r "^fake_tide.*")
34 set -U (string replace 'fake_' '' $fakeVar) $$fakeVar
35 end
36
37 # Make sure old prompt won't display
38 set -e $_tide_prompt_var 2>/dev/null
39
40 # Re-initialize the prompt
41 tide reload
42end
43
44function _tide_print_configure_current_options
45 _tide_fish_colorize "tide configure --auto $_tide_configure_current_options"
46end