about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-11 09:19:54 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-11 09:19:54 +0000
commitd0303296cdd465703ef95930ac254b73280b66bf (patch)
tree17e7a16b1916090c80f1cd73769bcb8c0fe4efdb
parent175ae571f38bb7f18125261b76c8e27074363bba (diff)
downloadzsh-d0303296cdd465703ef95930ac254b73280b66bf.tar.gz
zsh-d0303296cdd465703ef95930ac254b73280b66bf.tar.xz
zsh-d0303296cdd465703ef95930ac254b73280b66bf.zip
use expanded paths (expand style with value prefix) only when we are at the last matcher spec (16002)
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Type/_path_files8
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fbaf6ad1..1f2573921 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-11  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 16002: Completion/Unix/Type/_path_files: use expanded paths
+	(expand style with value prefix) only when we are at the last
+	matcher spec
+
 2001-10-10  Clint Adams  <clint@zsh.org>
 
 	* 16006: Completion/Unix/Type/_mailboxes, Doc/Zsh/compsys.yo:
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 811e63173..ff4240f90 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -656,9 +656,13 @@ done
 
 # If we are configured to expand paths as far as possible and we collected
 # expanded paths that are different from the string on the line, we add
-# them as possible matches.
+# them as possible matches. Do that only if we are currently trying the
+# last entry in the matcher-list style, otherwise other match specs might
+# make the suffix that didn't match this time match in one of the following
+# attempts.
 
-if zstyle -t ":completion:${curcontext}:paths" expand prefix &&
+if [[ _matcher_num -eq ${#_matchers} ]] &&
+   zstyle -t ":completion:${curcontext}:paths" expand prefix &&
    [[ nm -eq compstate[nmatches] && $#exppaths -ne 0 &&
       "$linepath$exppaths" != "$eorig" ]]; then
   PREFIX="${opre}"