From d2384f827856e5c312d8ec029ea251050acbf466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandros=20Koz=C3=A1k?= Date: Tue, 26 Dec 2017 09:25:22 -0800 Subject: [PATCH] Revert "Simplified _agkozak_prompt_dirtrim() logic" This reverts commit 0b0245e0162d2bc7b128addde81bfba59d1c86a0. --- agkozak-zsh-theme.plugin.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agkozak-zsh-theme.plugin.zsh b/agkozak-zsh-theme.plugin.zsh index b513e44..818cad9 100644 --- a/agkozak-zsh-theme.plugin.zsh +++ b/agkozak-zsh-theme.plugin.zsh @@ -95,11 +95,12 @@ _agkozak_prompt_dirtrim() { [[ $1 -ge 1 ]] || set 2 local abbreviated_path case $PWD in + $HOME) print -n '~' ;; # For TrueOS $HOME*) - abbreviated_path=$(print -Pn "%($(($1 + ${#HOME//[^\/]/}-1))~|~/.../%$1~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + 2))~|~/.../%${1}~|%~)") ;; *) - abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%$1~|%~)") + abbreviated_path=$(print -Pn "%($(($1 + 1))~|.../%${1}~|%~)") ;; esac print -n "$abbreviated_path"