mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 09:05:37 +03:00
Rename prompt_char to character
This commit is contained in:
parent
bf990577ed
commit
dfe5bb8618
22
functions/_tide_item_character.fish
Normal file
22
functions/_tide_item_character.fish
Normal file
@ -0,0 +1,22 @@
|
||||
function _tide_item_character
|
||||
if test $_tide_last_status = 0
|
||||
set -g tide_character_color $tide_character_success_color
|
||||
else
|
||||
set -g tide_character_color $tide_character_failure_color
|
||||
end
|
||||
|
||||
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||
_tide_print_item character
|
||||
else
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
tide_character_icon=$tide_character_vi_default_icon _tide_print_item character
|
||||
case insert
|
||||
tide_character_icon=$tide_character_vi_insert_icon _tide_print_item character
|
||||
case replace replace_one
|
||||
tide_character_icon=$tide_character_vi_replace_icon _tide_print_item character
|
||||
case visual
|
||||
tide_character_icon=$tide_character_vi_visual_icon _tide_print_item character
|
||||
end
|
||||
end
|
||||
end
|
@ -1,22 +0,0 @@
|
||||
function _tide_item_prompt_char
|
||||
if test $_tide_last_status = 0
|
||||
set -g tide_prompt_char_color $tide_prompt_char_success_color
|
||||
else
|
||||
set -g tide_prompt_char_color $tide_prompt_char_failure_color
|
||||
end
|
||||
|
||||
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||
_tide_print_item prompt_char
|
||||
else
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
tide_prompt_char_icon=$tide_prompt_char_vi_default_icon _tide_print_item prompt_char
|
||||
case insert
|
||||
tide_prompt_char_icon=$tide_prompt_char_vi_insert_icon _tide_print_item prompt_char
|
||||
case replace replace_one
|
||||
tide_prompt_char_icon=$tide_prompt_char_vi_replace_icon _tide_print_item prompt_char
|
||||
case visual
|
||||
tide_prompt_char_icon=$tide_prompt_char_vi_visual_icon _tide_print_item prompt_char
|
||||
end
|
||||
end
|
||||
end
|
@ -1,7 +1,7 @@
|
||||
function _tide_item_status
|
||||
if string match --quiet --invert 0 $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus
|
||||
if test "$_tide_last_pipestatus" = 1 # If simple failure
|
||||
if not contains prompt_char $tide_left_prompt_items
|
||||
if not contains character $tide_left_prompt_items
|
||||
set -g tide_status_bg_color $tide_status_failure_bg_color
|
||||
set -g tide_status_color $tide_status_failure_color
|
||||
tide_status_icon=$tide_status_failure_icon _tide_print_item status 1
|
||||
@ -19,7 +19,7 @@ function _tide_item_status
|
||||
(fish_status_to_signal $_tide_last_pipestatus | string replace SIG '' | string join '|')
|
||||
end
|
||||
end
|
||||
else if not contains prompt_char $tide_left_prompt_items
|
||||
else if not contains character $tide_left_prompt_items
|
||||
set -g tide_status_bg_color $tide_status_success_bg_color
|
||||
set -g tide_status_color $tide_status_success_color
|
||||
tide_status_icon=$tide_status_success_icon _tide_print_item status
|
||||
|
@ -11,7 +11,7 @@ function _tide_left_prompt
|
||||
end
|
||||
end
|
||||
|
||||
if test "$tide_last_item" != newline -a "$tide_last_item" != prompt_char
|
||||
if test "$tide_last_item" != newline -a "$tide_last_item" != character
|
||||
set_color $tide_previous_bg_color -b normal
|
||||
printf '%s' $tide_left_prompt_suffix
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ function _tide_print_item -a item
|
||||
|
||||
if test "$_tide_which_side_working_on" = left
|
||||
if test "$tide_last_item" = newline
|
||||
if test "$item" != prompt_char
|
||||
if test "$item" != character
|
||||
set_color $itemBgColorName -b normal
|
||||
printf '%s' $tide_left_prompt_prefix
|
||||
end
|
||||
@ -19,7 +19,7 @@ function _tide_print_item -a item
|
||||
end
|
||||
else
|
||||
if test "$tide_last_item" = newline
|
||||
if test "$item" != prompt_char
|
||||
if test "$item" != character
|
||||
set_color $itemBgColorName -b normal
|
||||
printf '%s' $tide_right_prompt_prefix
|
||||
end
|
||||
@ -34,7 +34,7 @@ function _tide_print_item -a item
|
||||
|
||||
set_color $itemColor -b $itemBgColor
|
||||
|
||||
test "$tide_prompt_pad_items" = true -a "$item" != prompt_char && set -l padItem ' '
|
||||
test "$tide_prompt_pad_items" = true -a "$item" != character && set -l padItem ' '
|
||||
itemIconName=tide_"$item"_icon printf '%s' $padItem $$itemIconName' ' $argv[2..] $padItem
|
||||
|
||||
set -g tide_previous_bg_color $itemBgColor
|
||||
|
@ -11,7 +11,7 @@ function _tide_right_prompt
|
||||
end
|
||||
end
|
||||
|
||||
if test "$tide_last_item" != newline -a "$tide_last_item" != prompt_char
|
||||
if test "$tide_last_item" != newline -a "$tide_last_item" != character
|
||||
set_color $tide_previous_bg_color -b normal
|
||||
printf '%s' $tide_right_prompt_suffix
|
||||
end
|
||||
|
@ -80,7 +80,7 @@ function _tide_display_prompt -a var_name var_value
|
||||
end
|
||||
|
||||
function _set_all_items_bg_color -a color
|
||||
for var in (set --names | string match --regex "fake_.*_bg_color" | string match --invert --entire prompt_char)
|
||||
for var in (set --names | string match --regex "fake_.*_bg_color" | string match --invert --entire character)
|
||||
set $var $color
|
||||
end
|
||||
end
|
||||
|
@ -18,10 +18,10 @@ end
|
||||
|
||||
function _tide_finish
|
||||
# Deal with prompt char/vi mode
|
||||
if contains prompt_char $fake_tide_left_prompt_items
|
||||
if contains character $fake_tide_left_prompt_items
|
||||
_tide_find_and_remove vi_mode fake_tide_right_prompt_items
|
||||
else
|
||||
# If no prompt_char, insert vi_mode
|
||||
# If no character, insert vi_mode
|
||||
_tide_find_and_remove vi_mode fake_tide_right_prompt_items
|
||||
if contains time $fake_tide_right_prompt_items
|
||||
set fake_tide_right_prompt_items $fake_tide_right_prompt_items[1..-2] vi_mode $fake_tide_right_prompt_items[-1]
|
||||
|
@ -4,7 +4,7 @@ function powerline_prompt_frame
|
||||
_tide_option 1 'No frame'
|
||||
set fake_tide_left_prompt_frame_enabled false
|
||||
set fake_tide_right_prompt_frame_enabled false
|
||||
set -a fake_tide_left_prompt_items prompt_char
|
||||
set -a fake_tide_left_prompt_items character
|
||||
_tide_display_prompt
|
||||
set -e fake_tide_left_prompt_items[-1]
|
||||
|
||||
@ -16,7 +16,7 @@ function powerline_prompt_frame
|
||||
_tide_option 3 Right
|
||||
set fake_tide_left_prompt_frame_enabled false
|
||||
set fake_tide_right_prompt_frame_enabled true
|
||||
set -a fake_tide_left_prompt_items prompt_char
|
||||
set -a fake_tide_left_prompt_items character
|
||||
_tide_display_prompt
|
||||
set -e fake_tide_left_prompt_items[-1]
|
||||
|
||||
@ -30,14 +30,14 @@ function powerline_prompt_frame
|
||||
case 1
|
||||
set fake_tide_left_prompt_frame_enabled false
|
||||
set fake_tide_right_prompt_frame_enabled false
|
||||
set -a fake_tide_left_prompt_items prompt_char
|
||||
set -a fake_tide_left_prompt_items character
|
||||
case 2
|
||||
set fake_tide_left_prompt_frame_enabled true
|
||||
set fake_tide_right_prompt_frame_enabled false
|
||||
case 3
|
||||
set fake_tide_left_prompt_frame_enabled false
|
||||
set fake_tide_right_prompt_frame_enabled true
|
||||
set -a fake_tide_left_prompt_items prompt_char
|
||||
set -a fake_tide_left_prompt_items character
|
||||
case 4
|
||||
set fake_tide_left_prompt_frame_enabled true
|
||||
set fake_tide_right_prompt_frame_enabled true
|
||||
|
@ -39,14 +39,14 @@ tide_php_bg_color 444444
|
||||
tide_php_color 875FFF
|
||||
tide_php_icon ''
|
||||
tide_print_newline_before_prompt true
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
tide_prompt_char_icon '❯'
|
||||
tide_prompt_char_success_color $_tide_color_green
|
||||
tide_prompt_char_vi_default_icon '❮'
|
||||
tide_prompt_char_vi_insert_icon '❯'
|
||||
tide_prompt_char_vi_replace_icon '▶'
|
||||
tide_prompt_char_vi_visual_icon V
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color FF0000
|
||||
tide_character_icon '❯'
|
||||
tide_character_success_color $_tide_color_green
|
||||
tide_character_vi_default_icon '❮'
|
||||
tide_character_vi_insert_icon '❯'
|
||||
tide_character_vi_replace_icon '▶'
|
||||
tide_character_vi_visual_icon V
|
||||
tide_prompt_connection_color 6C6C6C
|
||||
tide_prompt_connection_icon ''
|
||||
tide_pwd_bg_color 444444
|
||||
|
@ -23,9 +23,9 @@ tide_os_bg_color black
|
||||
tide_os_color brwhite
|
||||
tide_php_bg_color black
|
||||
tide_php_color brmagenta
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color brred
|
||||
tide_prompt_char_success_color brgreen
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color brred
|
||||
tide_character_success_color brgreen
|
||||
tide_prompt_connection_color brblack
|
||||
tide_pwd_bg_color black
|
||||
tide_pwd_color_anchors brcyan
|
||||
|
@ -25,7 +25,7 @@ tide_left_prompt_frame_enabled false
|
||||
tide_left_prompt_item_separator_diff_color ' '
|
||||
tide_left_prompt_item_separator_same_color ' '
|
||||
tide_left_prompt_item_separator_same_color_color 949494
|
||||
tide_left_prompt_items pwd git newline prompt_char
|
||||
tide_left_prompt_items pwd git newline character
|
||||
tide_left_prompt_pad_items false
|
||||
tide_left_prompt_prefix ''
|
||||
tide_left_prompt_suffix ' '
|
||||
@ -39,14 +39,14 @@ tide_php_bg_color normal
|
||||
tide_php_color 875FFF
|
||||
tide_php_icon ''
|
||||
tide_print_newline_before_prompt true
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
tide_prompt_char_icon '❯'
|
||||
tide_prompt_char_success_color $_tide_color_green
|
||||
tide_prompt_char_vi_default_icon '❮'
|
||||
tide_prompt_char_vi_insert_icon '❯'
|
||||
tide_prompt_char_vi_replace_icon '▶'
|
||||
tide_prompt_char_vi_visual_icon V
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color FF0000
|
||||
tide_character_icon '❯'
|
||||
tide_character_success_color $_tide_color_green
|
||||
tide_character_vi_default_icon '❮'
|
||||
tide_character_vi_insert_icon '❯'
|
||||
tide_character_vi_replace_icon '▶'
|
||||
tide_character_vi_visual_icon V
|
||||
tide_prompt_connection_color 6C6C6C
|
||||
tide_prompt_connection_icon ''
|
||||
tide_pwd_bg_color normal
|
||||
|
@ -23,9 +23,9 @@ tide_os_bg_color normal
|
||||
tide_os_color brwhite
|
||||
tide_php_bg_color normal
|
||||
tide_php_color brmagenta
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color brred
|
||||
tide_prompt_char_success_color brgreen
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color brred
|
||||
tide_character_success_color brgreen
|
||||
tide_prompt_connection_color brblack
|
||||
tide_pwd_bg_color normal
|
||||
tide_pwd_color_anchors brcyan
|
||||
|
@ -39,14 +39,14 @@ tide_php_bg_color 75507B
|
||||
tide_php_color 000000
|
||||
tide_php_icon ''
|
||||
tide_print_newline_before_prompt true
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color FF0000
|
||||
tide_prompt_char_icon '❯'
|
||||
tide_prompt_char_success_color $_tide_color_green
|
||||
tide_prompt_char_vi_default_icon '❮'
|
||||
tide_prompt_char_vi_insert_icon '❯'
|
||||
tide_prompt_char_vi_replace_icon '▶'
|
||||
tide_prompt_char_vi_visual_icon V
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color FF0000
|
||||
tide_character_icon '❯'
|
||||
tide_character_success_color $_tide_color_green
|
||||
tide_character_vi_default_icon '❮'
|
||||
tide_character_vi_insert_icon '❯'
|
||||
tide_character_vi_replace_icon '▶'
|
||||
tide_character_vi_visual_icon V
|
||||
tide_prompt_connection_color 6C6C6C
|
||||
tide_prompt_connection_icon ''
|
||||
tide_pwd_bg_color 3465A4
|
||||
|
@ -23,9 +23,9 @@ tide_os_bg_color white
|
||||
tide_os_color black
|
||||
tide_php_bg_color magenta
|
||||
tide_php_color black
|
||||
tide_prompt_char_bg_color normal
|
||||
tide_prompt_char_failure_color brred
|
||||
tide_prompt_char_success_color brgreen
|
||||
tide_character_bg_color normal
|
||||
tide_character_failure_color brred
|
||||
tide_character_success_color brgreen
|
||||
tide_prompt_connection_color brblack
|
||||
tide_pwd_bg_color blue
|
||||
tide_pwd_color_anchors brwhite
|
||||
|
@ -13,7 +13,7 @@ function _fake_tide_left_prompt
|
||||
set -l color $$colorName
|
||||
|
||||
if test "$lastItem" = newline
|
||||
if test "$item" != prompt_char
|
||||
if test "$item" != character
|
||||
set_color $color -b normal
|
||||
printf '%s' $fake_tide_left_prompt_prefix
|
||||
end
|
||||
@ -27,7 +27,7 @@ function _fake_tide_left_prompt
|
||||
|
||||
set_color -b $color
|
||||
|
||||
if test "$fake_tide_left_prompt_pad_items" = true -a "$item" != prompt_char
|
||||
if test "$fake_tide_left_prompt_pad_items" = true -a "$item" != character
|
||||
printf '%s' " $output "
|
||||
else
|
||||
printf '%s' "$output"
|
||||
@ -38,7 +38,7 @@ function _fake_tide_left_prompt
|
||||
set lastItem $item
|
||||
end
|
||||
|
||||
if test "$lastItem" != newline -a "$lastItem" != prompt_char
|
||||
if test "$lastItem" != newline -a "$lastItem" != character
|
||||
set_color $previousColor -b normal
|
||||
printf '%s' $fake_tide_left_prompt_suffix
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
function _fake_tide_item_prompt_char
|
||||
set_color $fake_tide_prompt_char_success_color
|
||||
function _fake_tide_item_character
|
||||
set_color $fake_tide_character_success_color
|
||||
printf '%s ' '❯'
|
||||
end
|
||||
|
@ -9,7 +9,7 @@ end
|
||||
set -lx tide_status_success_icon '✔'
|
||||
set -lx tide_status_failure_icon '✘'
|
||||
|
||||
# Without prompt_char
|
||||
# Without character
|
||||
set -lx tide_left_prompt_items
|
||||
|
||||
true
|
||||
@ -30,8 +30,8 @@ _status # CHECK: ✔ 1|0
|
||||
false | false
|
||||
_status # CHECK: ✘ 1|1
|
||||
|
||||
# With prompt_char
|
||||
set -lx tide_left_prompt_items prompt_char
|
||||
# With character
|
||||
set -lx tide_left_prompt_items character
|
||||
|
||||
true
|
||||
_status # CHECK:
|
||||
|
Loading…
Reference in New Issue
Block a user