Skip to content

Commit

Permalink
Revert "Simplified _agkozak_prompt_dirtrim() logic"
Browse files Browse the repository at this point in the history
This reverts commit 0b0245e.
  • Loading branch information
agkozak committed Dec 26, 2017
1 parent 0b0245e commit d2384f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agkozak-zsh-theme.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d2384f8

Please sign in to comment.