aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme7
1 files changed, 4 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 388141f9..ee5b6564 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -835,8 +835,9 @@ prompt_dir() {
fi
;;
truncate_to_unique)
- local -i i=2 n=1
+ local -i i=2 n=1 d=0
delim=${POWERLEVEL9K_SHORTEN_DELIMITER-'*'}
+ d=${POWERLEVEL9K_SHORTEN_DELIMITER_LENGTH:-$#POWERLEVEL9K_SHORTEN_DELIMITER}
(( POWERLEVEL9K_SHORTEN_DIR_LENGTH >= 0 )) && n=POWERLEVEL9K_SHORTEN_DIR_LENGTH
local pat=${POWERLEVEL9K_SHORTEN_FOLDER_MARKER-'(.bzr|CVS|.git|.hg|.svn|.citc)'}
local parent="${PWD%/${(pj./.)parts[i,-1]}}"
@@ -850,11 +851,11 @@ prompt_dir() {
fi
fi
local -i j=1
- for (( ; j + $#delim < $#dir; ++j )); do
+ for (( ; j + d < $#dir; ++j )); do
local -a matching=($parent/$dir[1,j]*/(N))
(( $#matching == 1 )) && break
done
- (( j + $#delim >= $#dir )) || parts[i]=$dir[1,j]$'\0'
+ (( j + d >= $#dir )) || parts[i]=$dir[1,j]$'\0'
parent+=/$dir
done
;;