aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorSyphdias <syphdias+git@gmail.com>2019-05-27 00:35:15 +0300
committerSyphdias <syphdias+git@gmail.com>2019-05-27 00:35:15 +0300
commitc5816238014d9ec92dc6d0f50014aa82a0af6a29 (patch)
tree5b3c4e443adef24c658a858db20bd82c30462bb8 /powerlevel9k.zsh-theme
parent6c61fb5c20c015b9ec8d26946fda265c3904f3f7 (diff)
adds POWERLEVEL9K_SHORTEN_DELIMITER_LENGTH for truncate_to_unique
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
;;