Use set -q instead of count and substitution

This commit is contained in:
Ilan Cosman 2022-05-30 09:43:30 -07:00
parent c4e6dc455c
commit 844ebb6ee7

View File

@ -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