1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-25 13:30:07 +00:00

respect POWERLEVEL9K_SHORTEN_DIR_LENGTH when POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_last

This commit is contained in:
Roman Perepelitsa 2021-03-28 09:54:30 +02:00
parent d3de2e558c
commit eafd78c3e0

View file

@ -1768,9 +1768,12 @@ prompt_dir() {
fi fi
;; ;;
truncate_to_last) truncate_to_last)
if [[ $#parts -gt 2 || $p[1] != / && $#parts -gt 1 ]]; then shortenlen=${_POWERLEVEL9K_SHORTEN_DIR_LENGTH:-1}
(( shortenlen > 0 )) || shortenlen=1
local -i i='shortenlen+1'
if [[ $#parts -gt i || $p[1] != / && $#parts -gt shortenlen ]]; then
fake_first=1 fake_first=1
parts[1,-2]=() parts[1,-i]=()
fi fi
;; ;;
truncate_to_first_and_last) truncate_to_first_and_last)