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

PATCH: Re: Problem with ZLS_COLOURS (zsh-3.1.6-test-2)



Thomas Koehler wrote:

> I have a slight problem with ZLS_COLOURS - the colours aren't being used
> in all cases :-(
> I use this:
> ZLS_COLOURS="no=36;40:fi=36;40:di=32;40:ln=36;40:pi=31;40:so=22;40:bd=44;37:cd=44;37:ex=35;40:mi=36;40:lc=\e[:rc=m:ec=:ma=37;41:*=36;40"
>
> ...
>
> jean-luc@picard (ttyp5) ~> ls a<TAB>
> -> works, shows all 3 matches in cyan as desired
> 
> jean-luc@picard (ttyp5) ~> ls a<TAB>
> -> doesn't work, shows all 3 matches uncoloured
> 
> Any hints what goes wrong? Did I miss an option or is this really a bug?

This patch makes `*=...' be used (it was explicitly ignored, I don't
remember why did it -- maybe GNU-ls does it?).

And it also resets `last_col' before printing the list -- maybe I'm
getting blind, but maybe this was really missing.

Together (or either of them) may solve the problem -- could you please 
try it?

Bye
 Sven

diff -u os/Zle/complist.c Src/Zle/complist.c
--- os/Zle/complist.c	Tue Jul 20 08:54:18 1999
+++ Src/Zle/complist.c	Tue Jul 20 13:01:05 1999
@@ -159,17 +159,15 @@
 	n = ++s;
 	while (*s && *s != '=')
 	    s++;
-	if (!*s )
+	if (!*s)
 	    return s;
 	*s++ = '\0';
 	p = getcolval(s);
-	if (*n) {
-	    ec = (Extcol) zhalloc(sizeof(*ec));
-	    ec->ext = n;
-	    ec->col = s;
-	    ec->next = c->exts;
-	    c->exts = ec;
-	}
+	ec = (Extcol) zhalloc(sizeof(*ec));
+	ec->ext = n;
+	ec->col = s;
+	ec->next = c->exts;
+	c->exts = ec;
 	if (*p)
 	    *p++ = '\0';
 	return p;
@@ -460,6 +458,7 @@
 	}
     }
     /* Now print the matches. */
+    last_col = COL_NO - 1;
     g = amatches;
     while (g) {
 	char **pp = g->ylist;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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