From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: hidden matches in menu-select
Date: Wed, 8 Dec 1999 14:49:44 +0100 (MET) [thread overview]
Message-ID: <199912081349.OAA27690@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Wed, 8 Dec 1999 10:13:06 +0000
Bart Schaefer wrote:
> (Maybe we should change the color-cap to "du"plicate instead of "mu"ltiple?
> Neither the original paragraph nor this rewite explains the derivation of
> "mu".)
Good idea. I wasn't too lucky with it anyway because we already had
`ma' and `mi'.
This also fixes a small bug which made the listing code think that
(almost) all matches were duplicates.
Bye
Sven
diff -ru ../z.old/Doc/Zsh/mod_complist.yo Doc/Zsh/mod_complist.yo
--- ../z.old/Doc/Zsh/mod_complist.yo Wed Dec 8 14:44:36 1999
+++ Doc/Zsh/mod_complist.yo Wed Dec 8 14:45:02 1999
@@ -167,7 +167,7 @@
in the list (because they differ only in things like prefixes or
suffixes that are not displayed). In the list used for menu-selection,
however, even these matches are shown so that it is possible to select
-them. To highlight such matches the tt(hi) and tt(mu) capabilities in
+them. To highlight such matches the tt(hi) and tt(du) capabilities in
the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters are supported for
hidden matches of the first and second kind, respectively.
diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c
--- ../z.old/Src/Zle/compcore.c Wed Dec 8 10:09:32 1999
+++ Src/Zle/compcore.c Wed Dec 8 14:20:15 1999
@@ -2368,16 +2368,21 @@
(int (*) _((const void *, const void *)))matchcmp);
if (!(flags & CGF_UNIQCON)) {
+ int dup;
+
/* And delete the ones that occur more than once. */
for (ap = cp = rp; *ap; ap++) {
*cp++ = *ap;
for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--);
ap = bp;
/* Mark those, that would show the same string in the list. */
- for (; bp[1] && !(*ap)->disp && !(bp[1])->disp &&
- !strcmp((*ap)->str, (bp[1])->str); bp++)
+ for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp &&
+ !strcmp((*ap)->str, (bp[1])->str); bp++) {
(bp[1])->flags |= CMF_MULT;
- (*ap)->flags |= CMF_FMULT;
+ dup = 1;
+ }
+ if (dup)
+ (*ap)->flags |= CMF_FMULT;
}
*cp = NULL;
}
@@ -2399,14 +2404,19 @@
*cp = NULL;
}
} else if (!(flags & CGF_UNIQCON)) {
+ int dup;
+
for (ap = cp = rp; *ap; ap++) {
*cp++ = *ap;
for (bp = ap; bp[1] && matcheq(*ap, bp[1]); bp++, n--);
ap = bp;
- for (; bp[1] && !(*ap)->disp && !(bp[1])->disp &&
- !strcmp((*ap)->str, (bp[1])->str); bp++)
+ for (dup = 0; bp[1] && !(*ap)->disp && !(bp[1])->disp &&
+ !strcmp((*ap)->str, (bp[1])->str); bp++) {
(bp[1])->flags |= CMF_MULT;
- (*ap)->flags |= CMF_FMULT;
+ dup = 1;
+ }
+ if (dup)
+ (*ap)->flags |= CMF_FMULT;
}
*cp = NULL;
}
diff -ru ../z.old/Src/Zle/complist.c Src/Zle/complist.c
--- ../z.old/Src/Zle/complist.c Wed Dec 8 10:09:33 1999
+++ Src/Zle/complist.c Wed Dec 8 14:44:42 1999
@@ -58,7 +58,7 @@
#define COL_SP 14
#define COL_MA 15
#define COL_HI 16
-#define COL_MU 17
+#define COL_DU 17
#define NUM_COLS 18
@@ -70,7 +70,7 @@
static char *colnames[] = {
"no", "fi", "di", "ln", "pi", "so", "bd", "cd", "ex", "mi",
- "lc", "rc", "ec", "tc", "sp", "ma", "hi", "mu", NULL
+ "lc", "rc", "ec", "tc", "sp", "ma", "hi", "du", NULL
};
/* Default values. */
@@ -659,7 +659,7 @@
} else if (m->flags & CMF_NOLIST)
zcputs(&mcolors, g->name, COL_HI);
else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT)))
- zcputs(&mcolors, g->name, COL_MU);
+ zcputs(&mcolors, g->name, COL_DU);
else
subcols = putmatchcol(&mcolors, g->name, m->disp);
if (subcols)
@@ -698,7 +698,7 @@
} else if (m->flags & CMF_NOLIST)
zcputs(&mcolors, g->name, COL_HI);
else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT)))
- zcputs(&mcolors, g->name, COL_MU);
+ zcputs(&mcolors, g->name, COL_DU);
else if (buf)
subcols = putfilecol(&mcolors, g->name, path, buf->st_mode);
else
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-12-08 13:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-08 13:49 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-12-08 9:49 Sven Wischnowsky
1999-12-08 9:08 Sven Wischnowsky
1999-12-08 9:39 ` Andrej Borsenkow
1999-12-08 10:13 ` Bart Schaefer
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=199912081349.OAA27690@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).