Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _next_tags



Here is a bit of fixing to make it work correctly (as far as I can
see) with file-patterns.

Nothing new with respect to the combination of _next_tags and
labels. And maybe there'll never be.

Bye
 Sven

Index: Completion/Commands/_next_tags
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_next_tags,v
retrieving revision 1.3
diff -u -r1.3 _next_tags
--- Completion/Commands/_next_tags	2000/04/04 11:26:26	1.3
+++ Completion/Commands/_next_tags	2000/04/05 08:20:37
@@ -92,12 +92,20 @@
   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
 }
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author