mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-20 22:31:57 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
352ad4d608
2 changed files with 4 additions and 2 deletions
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ function testTruncationFromRightWorks() {
|
|||
mkdir -p $FOLDER
|
||||
cd $FOLDER
|
||||
|
||||
assertEquals "%K{blue} %F{black}/tm…/po…/1/12/12…/12…/12…/12…/12…/12…/123456789 %k%F{blue}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{blue} %F{black}/tmp/po…/1/12/123/12…/12…/12…/12…/12…/123456789 %k%F{blue}%f " "$(build_left_prompt)"
|
||||
|
||||
cd -
|
||||
rm -fr /tmp/powerlevel9k-test
|
||||
|
|
Loading…
Reference in a new issue