print config

This commit is contained in:
Ilan Cosman 2023-08-07 14:21:54 -07:00
parent bb00e03820
commit a3426e157f
3 changed files with 27 additions and 6 deletions

View File

@ -23,7 +23,7 @@ function _tide_sub_configure
end
if set -q _flag_auto
set -fx _flag_finish Yes
set -fx _flag_finish 'Overwrite your current tide config'
else if test $COLUMNS -lt 55 -o $LINES -lt 21
echo 'Terminal size too small; must be at least 55 x 21'
return 1
@ -99,6 +99,8 @@ function _tide_menu -a func
break
case $_tide_symbol_list
set -g _tide_selected_option $_tide_option_list[(contains -i $input $_tide_symbol_list)]
test "$func" != finish &&
set -a _tide_configure_current_options --$func=(string escape $_tide_selected_option)
set -e _tide_symbol_list
set -e _tide_option_list
break

View File

@ -1,16 +1,25 @@
function finish
set_color red
_tide_title 'Overwrite tide config?'
set_color normal
_tide_title Finish
_tide_option y Yes
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 Yes
case 'Overwrite your current tide config'
_tide_finish
command -q clear && clear
_tide_print_configure_current_options
case 'Exit and print the config you just generated'
set -e _tide_selected_option # Skip through all the _next_choices
command -q clear && clear
_tide_print_configure_current_options
end
end
@ -31,3 +40,11 @@ function _tide_finish
# Re-initialize the prompt
source (functions --details fish_prompt)
end
function _tide_print_configure_current_options
if command -q fish_indent
printf %s\n "tide configure --auto $_tide_configure_current_options" | fish_indent --ansi
else
printf %s\n "tide configure --auto $_tide_configure_current_options"
end
end

View File

@ -1,4 +1,6 @@
function style
set -g _tide_configure_current_options
_tide_title 'Prompt Style'
_tide_option 1 Lean