1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 13:50:09 +00:00

shrink-path: match only the beginning of the directory (#6862)

Fixes #6317
This commit is contained in:
Marc Cornellà 2018-05-26 19:31:17 +02:00 committed by GitHub
parent 2294bae06a
commit 5896c87155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,10 +88,10 @@ shrink_path () {
if (( named )) { if (( named )) {
for part in ${(k)nameddirs}; { 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}) tree=(${(s:/:)dir})
( (
if [[ $tree[1] == \~* ]] { if [[ $tree[1] == \~* ]] {