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

Re: Completion lists



Or even this?

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.127
diff -p -u -r1.127 complist.c
--- Src/Zle/complist.c	19 Jun 2011 16:26:11 -0000	1.127
+++ Src/Zle/complist.c	16 Sep 2011 21:06:08 -0000
@@ -849,9 +849,9 @@ putmatchcol(char *group, char *n)
 {
     Patcol pc;
 
-    nrefs = MAX_POS - 1;
+    for (pc = mcolors.pats; pc; pc = pc->next) {
+	nrefs = MAX_POS - 1;
 
-    for (pc = mcolors.pats; pc; pc = pc->next)
 	if ((!pc->prog || !group || pattry(pc->prog, group)) &&
 	    pattryrefs(pc->pat, n, -1, -1, 0, &nrefs, begpos, endpos)) {
 	    if (pc->cols[1]) {
@@ -863,6 +863,7 @@ putmatchcol(char *group, char *n)
 
 	    return 0;
 	}
+    }
 
     zcputs(group, COL_NO);
 
@@ -880,9 +881,9 @@ putfilecol(char *group, char *filename, 
     Patcol pc;
     int len;
 
-    nrefs = MAX_POS - 1;
+    for (pc = mcolors.pats; pc; pc = pc->next) {
+	nrefs = MAX_POS - 1;
 
-    for (pc = mcolors.pats; pc; pc = pc->next)
 	if ((!pc->prog || !group || pattry(pc->prog, group)) &&
 	    pattryrefs(pc->pat, filename, -1, -1, 0, &nrefs, begpos, endpos)) {
 	    if (pc->cols[1]) {
@@ -894,6 +895,7 @@ putfilecol(char *group, char *filename, 
 
 	    return 0;
 	}
+    }
 
     if (special != -1) {
 	colour = special;

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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