1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +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.
)
item(tt(-1))(
If given together with the tt(-J) option, makes duplicate matches in
the group be kept. If given together with the tt(-V) option, makes
If given together with the tt(-V) option, makes
only consecutive duplicates in the group be removed. Note that groups
with and without this flag are in different name spaces.
)
item(tt(-2))(
If given together with the tt(-J) option, behaves the same as
tt(-J). If given together with the tt(-V) option, keep all duplicate
matches. Again, groups with and without this flag are in different
name spaces.
If given together with the tt(-J) or tt(-V) option, makes all
duplicates be kept. Again, groups with and without this flag are in
different name spaces.
)
item(tt(-M) var(match-spec))(
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.
)
item(tt(-1))(
If given together with the tt(-J) option, makes duplicate matches in
the group be kept. If given together with the tt(-V) option, makes
If given together with the tt(-V) option, makes
only consecutive duplicates in the group be removed. Note that groups
with and without this flag are in different name spaces.
)
item(tt(-2))(
If given together with the tt(-J) option, behaves the same as
tt(-J). If given together with the tt(-V) option, keep all duplicate
matches. Again, groups with and without this flag are in different
name spaces.
If given together with the tt(-J) or tt(-V) option, makes all
duplicates be kept. Again, groups with and without this flag are in
different name spaces.
)
item(tt(-X) var(explanation))(
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. */
static int noselect, mselect, inselect, mcol, mline, mcols, mlines;
static Cmatch *mmatch, **mtab;
static Cmgroup mgroup, *mgtab;
static Cmatch **mtab, **mmtabp;
static Cmgroup *mgtab, *mgtabp;
static struct listcols mcolors;
@ -346,11 +346,11 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
mtab[mm] = mp;
mgtab[mm] = g;
mmtabp = mtab + mm;
mgtabp = mgtab + mm;
}
if (m->gnum == mselect) {
mline = ml;
mmatch = mp;
mgroup = g;
cc = COL_MA;
} else
cc = COL_NO;
@ -377,12 +377,12 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
mtab[mx + mm] = mp;
mgtab[mx + mm] = g;
mmtabp = mtab + mx + mm;
mgtabp = mgtab + mx + mm;
}
if (m->gnum == mselect) {
mcol = mx;
mline = ml;
mmatch = mp;
mgroup = g;
zcputs(&mcolors, COL_MA);
} else if (buf)
putcolstr(&mcolors, path, buf->st_mode);
@ -557,10 +557,8 @@ domenuselect(Hookdef dummy, Chdata dat)
break;
i = 1;
}
p = mtab + mcol + (mline * mcols);
pg = mgtab + mcol + (mline * mcols);
minfo.cur = *p;
minfo.group = *pg;
p = mmtabp;
pg = mgtabp;
getk:

View file

@ -7192,8 +7192,19 @@ static int
matchcmp(Cmatch *a, Cmatch *b)
{
if ((*a)->disp) {
if ((*b)->disp)
return strcmp((*a)->disp, (*b)->disp);
if ((*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;
}
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),
(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. */
for (ap = cp = rp; *ap; ap++) {
*cp++ = *ap;