mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-09-18 08:20:10 +00:00
Fix empty delimiter
Even if the delimiter is empty, the min length should be 1. This fixes #558
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user