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

Re: PATCH: _path_files -g



Tanaka Akira wrote:

> In article <200001121525.QAA02658@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>   Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > The patch below implements this behaviour and replaces
> > ignored-suffixes with ignored-patterns.
> 
> I found a problem with ignored-patterns.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D 
> is27e1u11% zstyle ":completion*::vi:*" ignored-patterns \*\?.bbl \*\?.blg 
> is27e1u11% touch zz.{tex,bbl,blg}
> is27e1u11% ls zz.*   
> zz.bbl  zz.blg  zz.tex
> is27e1u11% vi zz.b<TAB>
> 
> The last <TAB> just removes the word `zz.b' instead of listing files.

I tried it only with a simple test function where it happened to succeed.

The problem was that in some cases the last call to permmatches()
didn't switch to the alternate set.

Bye
 Sven

diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c
--- ../z.old/Src/Zle/compcore.c	Wed Jan 12 16:27:37 2000
+++ Src/Zle/compcore.c	Thu Jan 13 09:49:27 2000
@@ -2569,9 +2569,11 @@
     static int fi = 0;
     int nn, nl, ll, gn = 1, mn = 1, rn;
 
-    if (pmatches && !newmatches)
+    if (pmatches && !newmatches) {
+	if (last && fi)
+	    ainfo = fainfo;
 	return fi;
-
+    }
     newmatches = fi = 0;
 
     if (pmatches)
@@ -2587,7 +2589,7 @@
     }
     while (g) {
 	HEAPALLOC {
-	    if (empty(g->lmatches))
+	    if (fi)
 		/* We have no matches, try ignoring fignore. */
 		mlist = g->lfmatches;
 	    else

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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