summary refs log tree commit diff
path: root/Completion/Unix
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 /Completion/Unix
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)
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_path_files8
1 files changed, 6 insertions, 2 deletions
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}"