mirror of
https://github.com/IlanCosman/tide.git
synced 2024-08-16 19:50:22 +03:00
Add transient choice to configure
This commit is contained in:
parent
7c1497d4cc
commit
ccb149f045
@ -134,10 +134,21 @@ function _tide_display_prompt -a var_name var_value
|
||||
set -l right_prompt_string (string pad --width (math $fake_columns-$bottom_left_prompt_string_length) $prompt[1])
|
||||
set -l prompt[-1] "$prompt[-1]$right_prompt_string"
|
||||
|
||||
if not set -e _tide_configure_first_prompt_after_option
|
||||
test "$fake_tide_prompt_add_newline_before" = true && echo
|
||||
if set -q _configure_transient
|
||||
if contains newline $fake_tide_left_prompt_items
|
||||
string unescape $prompt[3..]
|
||||
else
|
||||
_fake_tide_item_character
|
||||
echo
|
||||
end
|
||||
else
|
||||
if not set -q _tide_configure_first_prompt_after_option
|
||||
test "$fake_tide_prompt_add_newline_before" = true && echo
|
||||
end
|
||||
string unescape $prompt[2..]
|
||||
end
|
||||
string unescape $prompt[2..]
|
||||
|
||||
set -e _tide_configure_first_prompt_after_option
|
||||
set_color normal
|
||||
end
|
||||
|
||||
|
@ -13,7 +13,7 @@ function icons
|
||||
case 'Few icons'
|
||||
_disable_icons
|
||||
end
|
||||
_next_choice all/finish
|
||||
_next_choice all/transient
|
||||
end
|
||||
|
||||
function _enable_icons
|
||||
|
22
functions/tide/configure/choices/all/transient.fish
Normal file
22
functions/tide/configure/choices/all/transient.fish
Normal file
@ -0,0 +1,22 @@
|
||||
function transient
|
||||
_tide_title 'Enable transient prompt?'
|
||||
|
||||
_tide_option 1 No
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Yes
|
||||
_configure_transient= _tide_display_prompt
|
||||
_configure_transient= _tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case No
|
||||
set fake_tide_prompt_transient_enabled false
|
||||
case Yes
|
||||
set fake_tide_prompt_transient_enabled true
|
||||
end
|
||||
_next_choice all/finish
|
||||
end
|
@ -1,5 +1,8 @@
|
||||
function _fake_tide_item_character
|
||||
set_color $fake_tide_character_color
|
||||
contains newline $fake_tide_left_prompt_items || echo -ns ' '
|
||||
echo -ns $fake_tide_character_icon
|
||||
if contains newline $fake_tide_left_prompt_items || set -q _configure_transient
|
||||
echo -ns $fake_tide_character_icon
|
||||
else
|
||||
echo -ns ' '$fake_tide_character_icon
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user