mirror of
https://github.com/IlanCosman/tide.git
synced 2024-08-16 11:40:22 +03:00
Use set -q instead of count and substitution
This commit is contained in:
parent
c4e6dc455c
commit
844ebb6ee7
@ -28,7 +28,7 @@ eval "function _tide_pwd
|
||||
set split_output[\$i] \"$color_anchors\$dir_section$reset_to_color_dirs\"
|
||||
else if test \$_tide_pwd_len -gt \$dist_btwn_sides
|
||||
set -l trunc
|
||||
while string match -qr \"(?<trunc>\$trunc.)\" \$dir_section && test (count \$parent_dir/\$trunc*/) != 1
|
||||
while string match -qr \"(?<trunc>\$trunc.)\" \$dir_section && v=\$parent_dir/\$trunc*/ set -q v[2]
|
||||
end
|
||||
test -n \"\$trunc\" && set split_output[\$i] \"$color_truncated\$trunc$reset_to_color_dirs\" &&
|
||||
string join / \$split_output | string length -V | read _tide_pwd_len
|
||||
|
Loading…
Reference in New Issue
Block a user