zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: playing with backreferences in list-colors
Date: Mon, 24 Jan 2000 10:54:43 +0100 (MET)	[thread overview]
Message-ID: <200001240954.KAA09754@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 22 Jan 2000 18:17:55 +0100


Alexandre Duret-Lutz wrote:

> ...
> 
> Does string="./aafoo" in frame #1 means that `(#b)(a)#*' is matched
> over "./aafoo" instead of only "aafoo"?

Yes, it was indeed using the path, which was wrong in this case.

The rest of the patch makes the complist module be loaded if the
list-colors style is used and it isn't already loaded and it makes the 
reported position of -1 be used correctly.

Bye
 Sven

diff -ru ../z.old/Completion/Core/_setup Completion/Core/_setup
--- ../z.old/Completion/Core/_setup	Mon Jan 24 09:58:02 2000
+++ Completion/Core/_setup	Mon Jan 24 10:35:30 2000
@@ -3,6 +3,7 @@
 local val nm="$compstate[nmatches]"
 
 if zstyle -a ":completion${curcontext}:$1" list-colors val; then
+  zmodload -e zsh/complist || zmodload -i zsh/complist
   if [[ "$1" = default ]]; then
     ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}"
   else
diff -ru ../z.old/Src/Zle/complist.c Src/Zle/complist.c
--- ../z.old/Src/Zle/complist.c	Mon Jan 24 09:57:32 2000
+++ Src/Zle/complist.c	Mon Jan 24 10:44:16 2000
@@ -453,13 +453,13 @@
     curisbeg = curisend = 0;
 
     for (i = nrefs;  i < MAX_POS; i++)
-	begpos[i] = -1, endpos[i] = 0xfffffff;
+	begpos[i] = endpos[i] = -1;
 }
 
 static void
 doiscol(Listcols c, int pos)
 {
-    if (pos > endpos[curisend]) {
+    if (endpos[curisend] >= 0 && pos > endpos[curisend]) {
 	curisend++;
 	if (curiscol) {
 	    zcputs(c, NULL, COL_NO);
@@ -700,7 +700,7 @@
 	else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT)))
 	    zcputs(&mcolors, g->name, COL_DU);
 	else if (buf)
-	    subcols = putfilecol(&mcolors, g->name, path, buf->st_mode);
+	    subcols = putfilecol(&mcolors, g->name, m->str, buf->st_mode);
 	else
 	    subcols = putmatchcol(&mcolors, g->name, (m->disp ? m->disp : m->str));
 

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-01-24  9:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-24  9:54 Sven Wischnowsky [this message]
2000-01-24 15:07 ` Alexandre Duret-Lutz
2000-01-28  6:14 ` Bart Schaefer
2000-01-28  6:18   ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2000-01-28  8:14 Sven Wischnowsky
2000-01-24  9:14 Sven Wischnowsky
2000-01-22 17:17 Alexandre Duret-Lutz
2000-01-22 19:53 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200001240954.KAA09754@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).