mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 05:40:08 +00:00
shrink-path: match only the beginning of the directory (#6862)
Fixes #6317
This commit is contained in:
parent
2294bae06a
commit
5896c87155
1 changed files with 2 additions and 2 deletions
|
@ -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] == \~* ]] {
|
||||||
|
|
Loading…
Reference in a new issue