mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-20 22:31:57 +00:00
Fix bug when truncate root was set to direct subfolder of home or root
This commit is contained in:
parent
ebf808c533
commit
5cc2d51b58
1 changed files with 1 additions and 1 deletions
|
@ -615,7 +615,7 @@ prompt_dir() {
|
||||||
dir_truncate_root=$(upsearch $POWERLEVEL9K_ROOT_MARKER_FILE)
|
dir_truncate_root=$(upsearch $POWERLEVEL9K_ROOT_MARKER_FILE)
|
||||||
zero='%([BSUbfksu]|([FB]|){*})'
|
zero='%([BSUbfksu]|([FB]|){*})'
|
||||||
|
|
||||||
if [[ "$dir_truncate_root" == "/" || "$dir_truncate_root" == "$HOME" ]]; then
|
if [[ "$dir_truncate_root" == "/" || "$dir_truncate_root" == "$HOME" || "${dir_truncate_root%/*}" == "$HOME" || ${dir_truncate_root%/*} == "/" ]]; then
|
||||||
current_path='%~'
|
current_path='%~'
|
||||||
elif [[ "$dir_truncate_root" == "$HOME"* ]]; then
|
elif [[ "$dir_truncate_root" == "$HOME"* ]]; then
|
||||||
current_path="~/$POWERLEVEL9K_SHORTEN_DELIMITER/${dir_truncate_root##*/}${PWD:${#${(S%%)dir_truncate_root//$~zero/}}}"
|
current_path="~/$POWERLEVEL9K_SHORTEN_DELIMITER/${dir_truncate_root##*/}${PWD:${#${(S%%)dir_truncate_root//$~zero/}}}"
|
||||||
|
|
Loading…
Reference in a new issue