diff options
author | Marc Cornellà <marc.cornella@live.com> | 2018-05-26 19:31:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-26 19:31:17 +0200 |
commit | 5896c87155f9346a2926786c6d578d0a5696d712 (patch) | |
tree | 4ae477bd719db0282e4ff0e79831c98f3573c947 /plugins/shrink-path/shrink-path.plugin.zsh | |
parent | 2294bae06a27166dab9cebea60e76fb9de12d3d3 (diff) | |
download | zsh-5896c87155f9346a2926786c6d578d0a5696d712.tar.gz zsh-5896c87155f9346a2926786c6d578d0a5696d712.tar.bz2 zsh-5896c87155f9346a2926786c6d578d0a5696d712.zip |
shrink-path: match only the beginning of the directory (#6862)
Fixes #6317
Diffstat (limited to 'plugins/shrink-path/shrink-path.plugin.zsh')
-rw-r--r-- | plugins/shrink-path/shrink-path.plugin.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh index e7eed1705..29e6f0deb 100644 --- a/plugins/shrink-path/shrink-path.plugin.zsh +++ b/plugins/shrink-path/shrink-path.plugin.zsh @@ -88,10 +88,10 @@ shrink_path () { if (( named )) { for part in ${(k)nameddirs}; { - [[ $dir == ${nameddirs[$part]}(/*|) ]] && dir=${dir/${nameddirs[$part]}/\~$part} + [[ $dir == ${nameddirs[$part]}(/*|) ]] && dir=${dir/#${nameddirs[$part]}/\~$part} } } - (( tilde )) && dir=${dir/$HOME/\~} + (( tilde )) && dir=${dir/#$HOME/\~} tree=(${(s:/:)dir}) ( if [[ $tree[1] == \~* ]] { |