From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12015 invoked from network); 24 Jan 2000 09:54:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Jan 2000 09:54:49 -0000 Received: (qmail 18534 invoked by alias); 24 Jan 2000 09:54:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9416 Received: (qmail 18527 invoked from network); 24 Jan 2000 09:54:44 -0000 Date: Mon, 24 Jan 2000 10:54:43 +0100 (MET) Message-Id: <200001240954.KAA09754@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Alexandre Duret-Lutz's message of 22 Jan 2000 18:17:55 +0100 Subject: Re: playing with backreferences in list-colors 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