1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-08 12:01:21 +02:00

zsh-workers/8004

This commit is contained in:
Tanaka Akira 1999-09-22 22:32:20 +00:00
parent 9acc1dd713
commit bdecf74ef1
4 changed files with 30 additions and 25 deletions

View file

@ -517,16 +517,14 @@ space from the sorted ones, so groups defined as tt(-J files) and tt(-V
files) are distinct. files) are distinct.
) )
item(tt(-1))( item(tt(-1))(
If given together with the tt(-J) option, makes duplicate matches in If given together with the tt(-V) option, makes
the group be kept. If given together with the tt(-V) option, makes
only consecutive duplicates in the group be removed. Note that groups only consecutive duplicates in the group be removed. Note that groups
with and without this flag are in different name spaces. with and without this flag are in different name spaces.
) )
item(tt(-2))( item(tt(-2))(
If given together with the tt(-J) option, behaves the same as If given together with the tt(-J) or tt(-V) option, makes all
tt(-J). If given together with the tt(-V) option, keep all duplicate duplicates be kept. Again, groups with and without this flag are in
matches. Again, groups with and without this flag are in different different name spaces.
name spaces.
) )
item(tt(-M) var(match-spec))( item(tt(-M) var(match-spec))(
This defines additional matching control specifications that should be used This defines additional matching control specifications that should be used

View file

@ -464,16 +464,14 @@ item(tt(-V) var(name))(
Like tt(-J) but naming a unsorted group. Like tt(-J) but naming a unsorted group.
) )
item(tt(-1))( item(tt(-1))(
If given together with the tt(-J) option, makes duplicate matches in If given together with the tt(-V) option, makes
the group be kept. If given together with the tt(-V) option, makes
only consecutive duplicates in the group be removed. Note that groups only consecutive duplicates in the group be removed. Note that groups
with and without this flag are in different name spaces. with and without this flag are in different name spaces.
) )
item(tt(-2))( item(tt(-2))(
If given together with the tt(-J) option, behaves the same as If given together with the tt(-J) or tt(-V) option, makes all
tt(-J). If given together with the tt(-V) option, keep all duplicate duplicates be kept. Again, groups with and without this flag are in
matches. Again, groups with and without this flag are in different different name spaces.
name spaces.
) )
item(tt(-X) var(explanation))( item(tt(-X) var(explanation))(
As for tt(compctl) and tt(compgen), the var(explanation) string will be As for tt(compctl) and tt(compgen), the var(explanation) string will be

View file

@ -315,8 +315,8 @@ putcolstr(Listcols c, char *n, mode_t m)
/* Information about the list shown. */ /* Information about the list shown. */
static int noselect, mselect, inselect, mcol, mline, mcols, mlines; static int noselect, mselect, inselect, mcol, mline, mcols, mlines;
static Cmatch *mmatch, **mtab; static Cmatch **mtab, **mmtabp;
static Cmgroup mgroup, *mgtab; static Cmgroup *mgtab, *mgtabp;
static struct listcols mcolors; static struct listcols mcolors;
@ -346,11 +346,11 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
mtab[mm] = mp; mtab[mm] = mp;
mgtab[mm] = g; mgtab[mm] = g;
mmtabp = mtab + mm;
mgtabp = mgtab + mm;
} }
if (m->gnum == mselect) { if (m->gnum == mselect) {
mline = ml; mline = ml;
mmatch = mp;
mgroup = g;
cc = COL_MA; cc = COL_MA;
} else } else
cc = COL_NO; cc = COL_NO;
@ -377,12 +377,12 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
mtab[mx + mm] = mp; mtab[mx + mm] = mp;
mgtab[mx + mm] = g; mgtab[mx + mm] = g;
mmtabp = mtab + mx + mm;
mgtabp = mgtab + mx + mm;
} }
if (m->gnum == mselect) { if (m->gnum == mselect) {
mcol = mx; mcol = mx;
mline = ml; mline = ml;
mmatch = mp;
mgroup = g;
zcputs(&mcolors, COL_MA); zcputs(&mcolors, COL_MA);
} else if (buf) } else if (buf)
putcolstr(&mcolors, path, buf->st_mode); putcolstr(&mcolors, path, buf->st_mode);
@ -557,10 +557,8 @@ domenuselect(Hookdef dummy, Chdata dat)
break; break;
i = 1; i = 1;
} }
p = mtab + mcol + (mline * mcols); p = mmtabp;
pg = mgtab + mcol + (mline * mcols); pg = mgtabp;
minfo.cur = *p;
minfo.group = *pg;
getk: getk:

View file

@ -7192,8 +7192,19 @@ static int
matchcmp(Cmatch *a, Cmatch *b) matchcmp(Cmatch *a, Cmatch *b)
{ {
if ((*a)->disp) { if ((*a)->disp) {
if ((*b)->disp) if ((*b)->disp) {
return strcmp((*a)->disp, (*b)->disp); if ((*a)->flags & CMF_DISPLINE) {
if ((*b)->flags & CMF_DISPLINE)
return strcmp((*a)->disp, (*b)->disp);
else
return -1;
} else {
if ((*b)->flags & CMF_DISPLINE)
return 1;
else
return strcmp((*a)->disp, (*b)->disp);
}
}
return -1; return -1;
} }
if ((*b)->disp) if ((*b)->disp)
@ -7264,7 +7275,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
qsort((void *) rp, n, sizeof(Cmatch), qsort((void *) rp, n, sizeof(Cmatch),
(int (*) _((const void *, const void *)))matchcmp); (int (*) _((const void *, const void *)))matchcmp);
if (!(flags & (CGF_UNIQALL | CGF_UNIQCON))) { if (!(flags & CGF_UNIQCON)) {
/* And delete the ones that occur more than once. */ /* And delete the ones that occur more than once. */
for (ap = cp = rp; *ap; ap++) { for (ap = cp = rp; *ap; ap++) {
*cp++ = *ap; *cp++ = *ap;