shrink-path: match only the beginning of the directory (#6862)
Fixes #6317
This commit is contained in:
parent
2294bae06a
commit
5896c87155
@ -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] == \~* ]] {
|
||||
|
Loading…
Reference in New Issue
Block a user