diff options
-rw-r--r-- | Completion/Core/_path_files | 20 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 4 |
2 files changed, 13 insertions, 11 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 8c3b4ca63..0291762cb 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -3,7 +3,7 @@ # Utility function for in-path completion. This allows `/u/l/b<TAB>' # to complete to `/usr/local/bin'. -local linepath realpath donepath prepath testpath exppath +local linepath realpath donepath prepath testpath exppath skips local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre local pats haspats=no ignore group expl addpfx addsfx remsfx rem remt local nm=$compstate[nmatches] menu mspec matcher mopts atmp sort match @@ -157,13 +157,9 @@ if zstyle -s ":completion${curcontext}:files" sort tmp1; then fi fi -# Squeeze sequences of slashes -if zstyle -t ":completion${curcontext}:paths" squeeze-slashes -then - PREFIX="${PREFIX//(\\/)#//}" - SUFFIX="${SUFFIX//(\\/)#//}" - [[ $PREFIX = */ ]] && SUFFIX=${SUFFIX#/} -fi +# Skip over sequences of slashes. + +zstyle -t ":completion${curcontext}:paths" squeeze-slashes && skips=yes # We get the prefix and the suffix from the line and save the whole # original string. Then we see if we will do menucompletion. @@ -272,6 +268,14 @@ for prepath in "$prepaths[@]"; do continue fi + # Skip over multiple slashes? + + if [[ -n "$skips" && "$tpre" = /* ]]; then + tmp1=( ${^tmp1}/ ) + tpre="${tpre#/}" + continue + fi + # Get the prefix and suffix for matching. if [[ "$tpre" = */* ]]; then diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index f25ef093f..0126a4544 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1199,9 +1199,7 @@ if it is set to tt(..), only `tt(..)' will be added. ) item(tt(squeeze-slashes))( If set to `true', sequences of slashes (like in `tt(foo//bar)') will be -rewritten with a single slash (`tt(foo/bar)') when completing directory -names. Using this style can confuse tt(zsh) if slashes get squeezed -before braces completion (e.g. when trying to complete `tt(//{etc)'). +treated as if they were only one slash when completing pathnames. ) item(tt(stop))( If set to `true', the tt(_history_complete_word) bindable |