summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-03-05 18:24:41 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-03-05 18:24:41 +0300
commit0205c01ba952b9dee87b4f7b734e61c47607b7a4 (patch)
treedec8817eff1e2de597dc0cd116377071d5ec5222 /internal
parentcdb856e37490aa35d7eb9d9c0dd947af6e8f20d3 (diff)
change the semantics of POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER to something useful
If POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER is set to true, it'll remove the leading slash from the current directory if it's absolute. It will no longer do anything if the directory is not absolute or if the leading character has been removed or changed by the shortener.
Diffstat (limited to 'internal')
-rw-r--r--internal/p10k.zsh5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index f79861a4..c8c80295 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1915,8 +1915,9 @@ prompt_dir() {
(( expand )) && _p9k_escape $_POWERLEVEL9K_HOME_FOLDER_ABBREVIATION || _p9k__ret=$_POWERLEVEL9K_HOME_FOLDER_ABBREVIATION
parts[1]=$_p9k__ret
[[ $_p9k__ret == *%* ]] && parts[1]+=$style
+ elif [[ $_POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER == 1 && $fake_first == 0 && $#parts > 1 && -z $parts[1] && -n $parts[2] ]]; then
+ parts[1]=()
fi
- [[ $_POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER == 1 && $#parts > 1 && -n $parts[2] ]] && parts[1]=()
local last_style=
(( _POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD )) && last_style+=%B
@@ -7422,7 +7423,7 @@ _p9k_must_init() {
[[ $sig == $_p9k__param_sig ]] && return 1
_p9k_deinit
fi
- _p9k__param_pat=$'v66\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1'
+ _p9k__param_pat=$'v67\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'