mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 09:05:37 +03:00
Cut out intermediate icon variable
This commit is contained in:
parent
d5cc473304
commit
bb50c9ecfa
@ -2,18 +2,17 @@ set_color -o $tide_pwd_color_anchors | read -l color_anchors
|
||||
set_color $tide_pwd_color_truncated_dirs | read -l color_truncated
|
||||
set -l reset_to_color_dirs (set_color normal -b $tide_pwd_bg_color; set_color $tide_pwd_color_dirs)
|
||||
|
||||
set -l unwritable_icon $tide_pwd_icon_unwritable'\ '
|
||||
set -l home_icon $tide_pwd_icon_home'\ '
|
||||
set -l pwd_icon $tide_pwd_icon'\ '
|
||||
set -l unwritable_icon $tide_pwd_icon_unwritable' '
|
||||
set -l home_icon $tide_pwd_icon_home' '
|
||||
set -l pwd_icon $tide_pwd_icon' '
|
||||
|
||||
eval "function _tide_pwd
|
||||
if set -l split_pwd (string replace -r '^$HOME' '~' \$PWD | string split /)
|
||||
test -w . && set -f icon $pwd_icon || set -f icon $unwritable_icon
|
||||
test -w . && set -f split_output \"$pwd_icon\$split_pwd[1]\" \$split_pwd[2..] ||
|
||||
set -f split_output \"$unwritable_icon\$split_pwd[1]\" \$split_pwd[2..]
|
||||
else
|
||||
set -f icon $home_icon
|
||||
set -f split_output \"$home_icon\$split_pwd[1]\" \$split_pwd[2..]
|
||||
end
|
||||
|
||||
set -l split_output \"\$icon\$split_pwd[1]\" \$split_pwd[2..]
|
||||
set split_output[-1] \"$color_anchors\$split_output[-1]$reset_to_color_dirs\"
|
||||
|
||||
string join / \$split_output | string length -V | read -g _tide_pwd_len
|
||||
|
Loading…
Reference in New Issue
Block a user