5896c87155f9346a2926786c6d578d0a5696d712
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
shrink-path: match only the beginning of the directory (#6862)
Fixes #6317
Diff
1diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh
2index e7eed1705077c795cf7b8200d737916eec153e22..29e6f0debb61c9f40dd9f88ff835be4f4236b195 100644
3--- a/plugins/shrink-path/shrink-path.plugin.zsh
4+++ b/plugins/shrink-path/shrink-path.plugin.zsh
5@@ -88,10 +88,10 @@ shrink_path () {
6
7 if (( named )) {
8 for part in ${(k)nameddirs}; {
9- [[ $dir == ${nameddirs[$part]}(/*|) ]] && dir=${dir/${nameddirs[$part]}/\~$part}
10+ [[ $dir == ${nameddirs[$part]}(/*|) ]] && dir=${dir/#${nameddirs[$part]}/\~$part}
11 }
12 }
13- (( tilde )) && dir=${dir/$HOME/\~}
14+ (( tilde )) && dir=${dir/#$HOME/\~}
15 tree=(${(s:/:)dir})
16 (
17 if [[ $tree[1] == \~* ]] {