aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-15 19:51:26 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-15 19:51:51 +0300
commita3282100f01110a4b9a2f7005749ea0c5672655e (patch)
tree5eaf8dffb20838750458e692b30040fa4ba9618f /internal/p10k.zsh
parentcee4a16e7d843ce9bf6407f5df9252cad6d300b2 (diff)
bug fix: truncate_to_last didn't behave like %1~ in / and /foo
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh8
1 files 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'