aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorAlex LaFroscia <alex@lafroscia.com>2016-03-18 01:00:20 +0300
committerAlex LaFroscia <alex@lafroscia.com>2016-03-22 20:14:10 +0300
commit4ca6938801daf7158edc3b8e1922aa748d07eb18 (patch)
tree189195c14d5e04747f1e75c1244cbcdd2cbca173 /powerlevel9k.zsh-theme
parentdaa7255e85e939293bca28e93c8a058425368243 (diff)
Apply max dir length to package name shortener
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme6
1 files changed, 3 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 89b38e48..67406aca 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -444,7 +444,7 @@ prompt_dir() {
current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\2\//g")
;;
truncate_from_right)
- current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\//g")
+ current_path=$(truncatePathFromRight $(pwd | sed -e "s,^$HOME,~,") )
;;
truncate_with_package_name)
local name repo_path package_path current_dir zero
@@ -466,7 +466,7 @@ prompt_dir() {
# Then, find the length of the package_path string, and save the
# subdirectory path as a substring of the current directory's path from 0
# to the length of the package path's string
- subdirectory_path="/${current_dir:${#${(S%%)package_path//$~zero/}}}"
+ subdirectory_path=$(truncatePathFromRight "/${current_dir:${#${(S%%)package_path//$~zero/}}}")
fi
fi
@@ -479,7 +479,7 @@ prompt_dir() {
# from the package.json and append the current subdirectory
current_path="`echo $name | tr -d '"'`$subdirectory_path"
else
- current_path='%~'
+ current_path=$(truncatePathFromRight $(pwd | sed -e "s,^$HOME,~,") )
fi
;;
*)