|
|
|
@ -204,5 +204,7 @@ function segmentShouldBeJoined() {
|
|
|
|
|
# Given a directory path, truncate it according to the settings for
|
|
|
|
|
# `truncate_from_right`
|
|
|
|
|
function truncatePathFromRight() {
|
|
|
|
|
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\//g"
|
|
|
|
|
local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER}
|
|
|
|
|
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \
|
|
|
|
|
"s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g"
|
|
|
|
|
}
|
|
|
|
|