Minor edits

This commit is contained in:
Ilan Cosman 2021-09-30 09:17:51 -07:00
parent 45f598723b
commit 3a34269fde

View File

@ -2,18 +2,18 @@ function _tide_pwd
set -l split_pwd (string replace -- $HOME '~' $PWD | string split /)
if not test -w $PWD
set -g tide_pwd_icon $tide_pwd_icon_unwritable' '
set -f icon $tide_pwd_icon_unwritable' '
else if test $PWD = $HOME
set -g tide_pwd_icon $tide_pwd_icon_home' '
set -f icon $tide_pwd_icon_home' '
else
set -g tide_pwd_icon $tide_pwd_icon' '
set -f icon $tide_pwd_icon' '
end
# Anchor first and last directories (which may be the same)
if test -n "$split_pwd[1]" # ~/foo/bar, hightlight ~
set split_pwd_for_output "$_tide_reset_to_color_dirs$tide_pwd_icon"$_tide_color_anchors$split_pwd[1]$_tide_reset_to_color_dirs $split_pwd[2..]
set split_pwd_for_output "$_tide_reset_to_color_dirs$icon"$_tide_color_anchors$split_pwd[1]$_tide_reset_to_color_dirs $split_pwd[2..]
else # /foo/bar, hightlight foo not empty string
set split_pwd_for_output "$_tide_reset_to_color_dirs$tide_pwd_icon" $_tide_color_anchors$split_pwd[2]$_tide_reset_to_color_dirs $split_pwd[3..]
set split_pwd_for_output "$_tide_reset_to_color_dirs$icon" $_tide_color_anchors$split_pwd[2]$_tide_reset_to_color_dirs $split_pwd[3..]
end
set split_pwd_for_output[-1] $_tide_color_anchors$split_pwd[-1]$_tide_reset_to_color_dirs