1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

Added test for dir_length == trunc_length

This commit is contained in:
Christo Kotze 2018-02-18 16:35:07 +04:00
parent b1b0ad949a
commit 8180d724ef

View file

@ -761,7 +761,7 @@ prompt_dir() {
cur_dir=$directory
dir_length=${#cur_dir}
local threshhold=$(( $POWERLEVEL9K_SHORTEN_DIR_LENGTH + ${#delim} ))
if (( ( $dir_length + 1) > $threshhold )) && [[ $cur_dir != $paths[${#paths}] ]]; then # only shorten if long enough and not last path
if (( ( $dir_length > $threshhold )) && [[ !c $dir_length == $POWERLEVEL9K_SHORTEN_DIR_LENGTH && $cur_dir != $paths[${#paths}] ]]; then # only shorten if long enough and not last path
cur_dir=${cur_dir:0:$POWERLEVEL9K_SHORTEN_DIR_LENGTH}$delim
fi
cur_short_path+="$cur_dir/"