about summary refs log tree commit diff
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
parent2697c3d52cda2cf4f88ab81cde2a37afc1796c7e (diff)
downloadzsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.tar.gz
zsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.tar.xz
zsh-c6c1947180c79e5bdc068fdb43c336be9738dd45.zip
zsh-workers/9403
-rw-r--r--Completion/Core/_path_files20
-rw-r--r--Doc/Zsh/compsys.yo4
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