mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-22 23:03:26 +03:00
Further optimize pwd truncation
This commit is contained in:
parent
46587cb19b
commit
2d5474005c
@ -27,9 +27,8 @@ function _tide_pwd
|
|||||||
end
|
end
|
||||||
set split_output[$i] $_tide_color_anchors$dir_section$_tide_reset_to_color_dirs
|
set split_output[$i] $_tide_color_anchors$dir_section$_tide_reset_to_color_dirs
|
||||||
else if test $pwd_length -gt $dist_btwn_sides
|
else if test $pwd_length -gt $dist_btwn_sides
|
||||||
trunc_len=1 while string match -qr "(?<trunc>.{$trunc_len})" $dir_section &&
|
set -l trunc
|
||||||
test (count $parent_dir/$trunc*/) != 1
|
while string match -qr "(?<trunc>$trunc.)" $dir_section && test (count $parent_dir/$trunc*/) != 1
|
||||||
math $trunc_len+1 | read trunc_len
|
|
||||||
end
|
end
|
||||||
test -n "$trunc" && set split_output[$i] $_tide_color_truncated_dirs$trunc$_tide_reset_to_color_dirs &&
|
test -n "$trunc" && set split_output[$i] $_tide_color_truncated_dirs$trunc$_tide_reset_to_color_dirs &&
|
||||||
string join / $split_output | string length --visible | read -g pwd_length
|
string join / $split_output | string length --visible | read -g pwd_length
|
||||||
|
Loading…
Reference in New Issue
Block a user