about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-05 08:24:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-05 08:24:59 +0000
commitbcd865f7d2f09fb42c755f0ad7f26f7ed26a60f0 (patch)
tree54c0d26ca52b0fe75e5998fa0512d8eb7779b583
parent2c8d808759e6e158c81329e474e4c4c84f8b50f7 (diff)
downloadzsh-bcd865f7d2f09fb42c755f0ad7f26f7ed26a60f0.tar.gz
zsh-bcd865f7d2f09fb42c755f0ad7f26f7ed26a60f0.tar.xz
zsh-bcd865f7d2f09fb42c755f0ad7f26f7ed26a60f0.zip
fix for combining _next_tags and file-patterns
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Commands/_next_tags12
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e18ff3d11..07811c90f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-05  Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
+
+	* 10498: Completion/Commands/_next_tags: fix for handling
+	file-patterns.
+
 2000-04-04  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
 	* Clint: 10477: Functions/Zftp/zfcd_match: some awks don't like
diff --git a/Completion/Commands/_next_tags b/Completion/Commands/_next_tags
index 867cf0b98..d9a5f08d8 100644
--- a/Completion/Commands/_next_tags
+++ b/Completion/Commands/_next_tags
@@ -92,12 +92,20 @@ _next_tags_sort() {
   if [[ -z "$nodef" ]]; then
     if [[ $funcstack[4] = _files ]]; then
       if zstyle -a ":completion:${curcontext}:" file-patterns tmp; then
-        [[ "$argv" = *${${tmp[-1]##[^\\]:}%:*}* ]] && _next_tags_reset=yes
+        [[ "$argv" = *${${tmp[-1]#*[^\\]:}%:*}* ]] && _next_tags_reset=yes
       else
         [[ "$argv" = *all-files* ]] && _next_tags_reset=yes
       fi
     fi
-    comptry "${(@)argv:#(${(j:|:)~${=_next_tags_not}})(|:*)}"
+    tmp=( "${(@)argv:#(${(j:|:)~${=_next_tags_not}})(|:*)}" )
+
+    # $prev is set in _tags!
+
+    if [[ -n "$prev" && ( $#tmp -ne 0 || $funcstack[4] = _files ) ]]; then
+      comptry "$tmp[@]"
+    else
+      comptry "$argv[@]"
+    fi
   fi
 }