From a3282100f01110a4b9a2f7005749ea0c5672655e Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 15 Feb 2020 17:51:26 +0100 Subject: [PATCH] bug fix: truncate_to_last didn't behave like %1~ in / and /foo --- internal/p10k.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index a95b04b6..b51eea47 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1766,8 +1766,10 @@ prompt_dir() { fi ;; truncate_to_last) - fake_first=$(($#parts > 1)) - parts[1,-2]=() + if [[ $#parts -gt 2 || $p[1] != / && $#parts -gt 1 ]]; then + fake_first=1 + parts[1,-2]=() + fi ;; truncate_to_first_and_last) if (( shortenlen > 0 )); then @@ -7017,7 +7019,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v48\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v49\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays'