Apply max dir length to package name shortener

This commit is contained in:
Alex LaFroscia
2016-03-22 13:14:10 -04:00
parent daa7255e85
commit 4ca6938801
3 changed files with 19 additions and 4 deletions
+6
View File
@@ -186,3 +186,9 @@ function segmentShouldBeJoined() {
return 1
fi
}
# 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"
}