From c6c1947180c79e5bdc068fdb43c336be9738dd45 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 21 Jan 2000 16:33:49 +0000 Subject: zsh-workers/9403 --- Completion/Core/_path_files | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Completion/Core/_path_files') 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' # 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 -- cgit 1.4.1