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

PATCH: small fix for complist



After playing some more with colors...

When complist printed a list with multiple groups, the variable that
keeps track of the last color code printed could get out of sync if a
description used color codes.

This also makes the sp capability be used for the empty `slots' at the 
bottom/right of the list.

Bye
 Sven

diff -u -r oldsrc/Zle/complist.c Src/Zle/complist.c
--- oldsrc/Zle/complist.c	Fri Dec  3 10:21:47 1999
+++ Src/Zle/complist.c	Fri Dec  3 13:22:49 1999
@@ -614,6 +614,8 @@
     return 0;
 }
 
+static Cmgroup last_group;
+
 static void
 clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
 	 char *path, struct stat *buf)
@@ -621,8 +623,13 @@
     Cmatch m;
     int len, subcols = 0;
 
+    if (g != last_group)
+        *last_cap = '\0';
+
+    last_group = g;
+
     if (!mp) {
-	zcputs(&mcolors, g->name, COL_MI);
+	zcputs(&mcolors, g->name, COL_SP);
 	len = width - 2;
 	while (len-- > 0)
 	    putc(' ', shout);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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