aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-19 08:50:43 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-19 08:50:43 +0300
commitb910da06a0afb35ee2aa35f550956e39f8450e0f (patch)
treefebcb6cf7c4dfa377c271937895c73005c41d9e1 /powerlevel9k.zsh-theme
parent7cfe479c87051b263ea34f1ddc6f605851040f51 (diff)
when replacing parts of cwd with "...", make sure there is more than 1 char to be replaced
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 2 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 366c4522..85a8f6e9 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -832,7 +832,7 @@ prompt_dir() {
case $POWERLEVEL9K_SHORTEN_STRATEGY in
truncate_absolute|truncate_absolute_chars)
- if (( POWERLEVEL9K_SHORTEN_DIR_LENGTH > 0 && $#p > POWERLEVEL9K_SHORTEN_DIR_LENGTH )); then
+ if (( POWERLEVEL9K_SHORTEN_DIR_LENGTH > 0 && $#p > POWERLEVEL9K_SHORTEN_DIR_LENGTH + 1 )); then
local -i n=POWERLEVEL9K_SHORTEN_DIR_LENGTH
local -i i=$#parts
while true; do
@@ -873,7 +873,7 @@ prompt_dir() {
[[ $POWERLEVEL9K_SHORTEN_STRATEGY == truncate_middle ]] && suf=pref
for (( ; i < $#parts; ++i )); do
local dir=$parts[i]
- if (( $#dir > pref + suf )); then
+ if (( $#dir > pref + suf + 1 )); then
dir[pref+1,-suf-1]=$'\0'
parts[i]=$dir
fi