aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-18 21:56:52 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-18 21:56:52 +0300
commitfb09d753915ff193f4896db0b74a1b67aef2cfa4 (patch)
tree879b5b8ae5a088db4305f3a7b776c46d9b8ae685 /powerlevel9k.zsh-theme
parent3b182d2eb6f97da5731ba543a2486622d6cfd287 (diff)
Updated truncate_to_unique
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme5
1 files changed, 3 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 70aca115..fcd1ab98 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -725,7 +725,7 @@ set_default POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD false
prompt_dir() {
local current_path="$(print -P '%~')"
local paths directory test_dir test_dir_length trunc_path threshhold
- (( ${#current_path} > 1 )) && paths=(${(s:/:)current_path}) || paths=() # only split if not root/home folder
+ (( ${#current_path} > 1 )) && paths=(${(s:/:)${current_path//"~\/"/}}) || paths=() # only split if not root/home folder
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then
set_default POWERLEVEL9K_SHORTEN_DELIMITER "\u2026"
local delim=$(echo -n $POWERLEVEL9K_SHORTEN_DELIMITER) # convert delimiter from unicode to literal character
@@ -861,7 +861,8 @@ prompt_dir() {
trunc_path+="$test_dir/"
cur_path+="$directory/"
done
- current_path="${trunc_path: : -1}"
+ [[ $current_path == "~"* ]] && current_path="~/" || current_path=""
+ current_path+="${trunc_path: : -1}"
fi
;;
*)