dir: ignore separator overrides if cwd is / and POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER is true

This commit is contained in:
Roman Perepelitsa 2020-09-29 13:40:06 +02:00
parent 3586cc8d7e
commit 42aa719e48
1 changed files with 16 additions and 12 deletions

View File

@ -1997,19 +1997,23 @@ prompt_dir() {
parts=("${(@)parts//$'\3'}") parts=("${(@)parts//$'\3'}")
fi fi
local sep='' if [[ $_p9k__cwd == / && $_POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER == 1 ]]; then
if (( $+parameters[_POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND] || local sep='/'
$+parameters[_POWERLEVEL9K_${(U)state}_PATH_SEPARATOR_FOREGROUND] )); then else
_p9k_color $state PATH_SEPARATOR_FOREGROUND '' local sep=''
_p9k_foreground $_p9k__ret if (( $+parameters[_POWERLEVEL9K_DIR_PATH_SEPARATOR_FOREGROUND] ||
(( expand )) && _p9k_escape_style $_p9k__ret $+parameters[_POWERLEVEL9K_${(U)state}_PATH_SEPARATOR_FOREGROUND] )); then
sep=$_p9k__ret _p9k_color $state PATH_SEPARATOR_FOREGROUND ''
_p9k_foreground $_p9k__ret
(( expand )) && _p9k_escape_style $_p9k__ret
sep=$_p9k__ret
fi
_p9k_param $state PATH_SEPARATOR /
_p9k__ret=${(g::)_p9k__ret}
(( expand )) && _p9k_escape $_p9k__ret
sep+=$_p9k__ret
[[ $sep == *%* ]] && sep+=$style
fi fi
_p9k_param $state PATH_SEPARATOR /
_p9k__ret=${(g::)_p9k__ret}
(( expand )) && _p9k_escape $_p9k__ret
sep+=$_p9k__ret
[[ $sep == *%* ]] && sep+=$style
local content="${(pj.$sep.)parts}" local content="${(pj.$sep.)parts}"
if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then