aboutsummaryrefslogtreecommitdiff
path: root/functions/utilities.zsh
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2017-07-12 04:29:31 +0300
committerDominik Ritter <dritter03@googlemail.com>2017-07-12 04:29:31 +0300
commita234636982349a82ab6c7f0674f3ff884acddc94 (patch)
tree044a37eb1716bd516884556045ddd9fbde28abba /functions/utilities.zsh
parent6735c24e621e435827f414103e8ab312c7eb8845 (diff)
Fix empty delimiter
Even if the delimiter is empty, the min length should be 1. This fixes #558
Diffstat (limited to 'functions/utilities.zsh')
-rw-r--r--functions/utilities.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index 86e5ba0e..39c5ecae 100644
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -212,7 +212,7 @@ function segmentShouldBeJoined() {
# Given a directory path, truncate it according to the settings for
# `truncate_from_right`
function truncatePathFromRight() {
- local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER}
+ local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER:-1}
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \
"s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g"
}