about summary refs log tree commit diff
path: root/Completion/Core/_path_files
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-21 16:33:49 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-21 16:33:49 +0000
commitc6c1947180c79e5bdc068fdb43c336be9738dd45 (patch)
tree65c766c6aa1450ea71da3160085bc0f4eb9fabfa /Completion/Core/_path_files
parent2697c3d52cda2cf4f88ab81cde2a37afc1796c7e (diff)
downloadzsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.tar.gz
zsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.tar.xz
zsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.zip
zsh-workers/9403
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r--Completion/Core/_path_files20
1 files changed, 12 insertions, 8 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