Fix bug when truncating single character directories

This commit is contained in:
Ilan Cosman 2021-03-16 09:03:19 -07:00
parent 8dcdc64296
commit 02adc2f08a

View File

@ -24,8 +24,8 @@ function _tide_item_pwd
set splitPwdForOutput[$i] $colorAnchors$splitPwd[$i]$keepBackgroundColor$colorDirs
else if test (string join -- '/' $splitPwdForLength | string length) -gt $pwdMaxLength
while set -l truncationLength (math $truncationLength + 1) &&
test $truncationLength != (string length -- $splitPwdForLength[$i]) &&
set -l truncated (string sub --length $truncationLength -- $splitPwd[$i]) &&
test $truncated != $splitPwd[$i] &&
test (count $parentDir/$truncated*/) -gt 1
end