Unverified Commit 5896c871 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

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

Fixes #6317
parent 2294bae0
......@@ -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] == \~* ]] {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment