Minor edits

This commit is contained in:
Ilan Cosman 2021-05-08 13:08:36 -07:00
parent 315d00fe66
commit 9b88923f30
3 changed files with 21 additions and 23 deletions

View File

@ -1,5 +1,5 @@
function _tide_item_newline
set_color $tide_previous_bg_color -b normal
set_color $_tide_previous_bg_color -b normal
sideWorkingOnSuffixName=tide_"$_tide_which_side_working_on"_prompt_suffix printf '%s' $$sideWorkingOnSuffixName \n
set -g tide_last_item newline
set -g _tide_last_item newline
end

View File

@ -2,29 +2,27 @@ function _tide_print_item -a item
itemBgColorName=tide_"$item"_bg_color set itemBgColor $$itemBgColorName
if test "$_tide_which_side_working_on" = left
if test "$tide_last_item" = newline
if test "$_tide_last_item" = newline
if test "$item" != character
set_color $itemBgColor -b normal
printf '%s' $tide_left_prompt_prefix
end
else if test "$itemBgColor" = "$tide_previous_bg_color"
else if test "$itemBgColor" = "$_tide_previous_bg_color"
set_color $tide_left_prompt_item_separator_same_color_color
printf '%s' $tide_left_prompt_item_separator_same_color
else
set_color $tide_previous_bg_color -b $itemBgColor
set_color $_tide_previous_bg_color -b $itemBgColor
printf '%s' $tide_left_prompt_item_separator_diff_color
end
else if test "$_tide_last_item" = newline
set_color $itemBgColor -b normal
printf '%s' $tide_right_prompt_prefix
else if test "$itemBgColor" = "$_tide_previous_bg_color"
set_color $tide_right_prompt_item_separator_same_color_color
printf '%s' $tide_right_prompt_item_separator_same_color
else
if test "$tide_last_item" = newline
set_color $itemBgColor -b normal
printf '%s' $tide_right_prompt_prefix
else if test "$itemBgColor" = "$tide_previous_bg_color"
set_color $tide_right_prompt_item_separator_same_color_color
printf '%s' $tide_right_prompt_item_separator_same_color
else
set_color $itemBgColor -b $tide_previous_bg_color
printf '%s' $tide_right_prompt_item_separator_diff_color
end
set_color $itemBgColor -b $_tide_previous_bg_color
printf '%s' $tide_right_prompt_item_separator_diff_color
end
itemColorName=tide_"$item"_color set_color $$itemColorName -b $itemBgColor
@ -35,6 +33,6 @@ function _tide_print_item -a item
printf '%s' $argv[2..]
end
set -g tide_previous_bg_color $itemBgColor
set -g tide_last_item $item
set -g _tide_previous_bg_color $itemBgColor
set -g _tide_last_item $item
end

View File

@ -30,15 +30,15 @@ function _tide_prompt
end
function _tide_left_prompt
set -g tide_last_item newline
set -g _tide_last_item newline
set -g _tide_which_side_working_on left
for item in $tide_left_prompt_items
_tide_item_$item
end
if not contains -- $tide_last_item newline character
set_color $tide_previous_bg_color -b normal
if not contains -- $_tide_last_item newline character
set_color $_tide_previous_bg_color -b normal
printf '%s' $tide_left_prompt_suffix
end
@ -46,15 +46,15 @@ function _tide_left_prompt
end
function _tide_right_prompt
set -g tide_last_item newline
set -g _tide_last_item newline
set -g _tide_which_side_working_on right
for item in $tide_right_prompt_items
_tide_item_$item
end
if test "$tide_last_item" != newline
set_color $tide_previous_bg_color -b normal
if test "$_tide_last_item" != newline
set_color $_tide_previous_bg_color -b normal
printf '%s' $tide_right_prompt_suffix
end