diff options
-rw-r--r-- | Doc/Zsh/mod_complist.yo | 2 | ||||
-rw-r--r-- | Src/Zle/compcore.c | 22 | ||||
-rw-r--r-- | Src/Zle/complist.c | 8 |
3 files changed, 21 insertions, 11 deletions
diff --git a/Doc/Zsh/mod_complist.yo b/Doc/Zsh/mod_complist.yo index 32067e1aa..1ec77a33d 100644 --- a/Doc/Zsh/mod_complist.yo +++ b/Doc/Zsh/mod_complist.yo @@ -162,7 +162,7 @@ builtin command) or they are matches which duplicate a string already 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 --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index c2767f90c..acf1799f6 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -2368,16 +2368,21 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp) (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 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp) *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 --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 6d4648446..c8d1914e3 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -58,7 +58,7 @@ static Keymap mskeymap; #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 Keymap mskeymap; 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 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width, } 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 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width, } 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 |