mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
zsh-workers/7791
This commit is contained in:
parent
679b7a7599
commit
a057b09368
1 changed files with 10 additions and 8 deletions
|
@ -7184,11 +7184,8 @@ permmatches(void)
|
||||||
n->mcount = g->mcount;
|
n->mcount = g->mcount;
|
||||||
n->matches = p = (Cmatch *) ncalloc((n->mcount + 1) *
|
n->matches = p = (Cmatch *) ncalloc((n->mcount + 1) *
|
||||||
sizeof(Cmatch));
|
sizeof(Cmatch));
|
||||||
for (rn = 1, q = g->matches; *q; q++, p++, rn) {
|
for (q = g->matches; *q; q++, p++)
|
||||||
*p = dupmatch(*q);
|
*p = dupmatch(*q);
|
||||||
(*p)->rnum = rn++;
|
|
||||||
(*p)->gnum = mn++;
|
|
||||||
}
|
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
|
|
||||||
n->lcount = g->lcount;
|
n->lcount = g->lcount;
|
||||||
|
@ -7219,6 +7216,12 @@ permmatches(void)
|
||||||
n->ccs = NULL;
|
n->ccs = NULL;
|
||||||
g = g->next;
|
g = g->next;
|
||||||
}
|
}
|
||||||
|
for (g = amatches; g; g = g->next) {
|
||||||
|
for (rn = 1, q = g->matches; *q; q++) {
|
||||||
|
(*q)->rnum = rn++;
|
||||||
|
(*q)->gnum = mn++;
|
||||||
|
}
|
||||||
|
}
|
||||||
pmatches = amatches;
|
pmatches = amatches;
|
||||||
hasperm = 1;
|
hasperm = 1;
|
||||||
permmnum = mn - 1;
|
permmnum = mn - 1;
|
||||||
|
@ -7289,6 +7292,7 @@ freematches(void)
|
||||||
g = n;
|
g = n;
|
||||||
}
|
}
|
||||||
hasperm = 0;
|
hasperm = 0;
|
||||||
|
minfo.cur = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert the given string into the command line. If move is non-zero, *
|
/* Insert the given string into the command line. If move is non-zero, *
|
||||||
|
@ -7950,7 +7954,7 @@ do_ambig_menu(void)
|
||||||
minfo.cur = NULL;
|
minfo.cur = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (oldlist) {
|
if (oldlist) {
|
||||||
if (oldins)
|
if (oldins && minfo.cur)
|
||||||
acceptlast();
|
acceptlast();
|
||||||
} else
|
} else
|
||||||
minfo.cur = NULL;
|
minfo.cur = NULL;
|
||||||
|
@ -7967,11 +7971,9 @@ do_ambig_menu(void)
|
||||||
}
|
}
|
||||||
insmnum = comp_mod(insmnum, (minfo.group)->mcount);
|
insmnum = comp_mod(insmnum, (minfo.group)->mcount);
|
||||||
} else {
|
} else {
|
||||||
int c = 0;
|
|
||||||
|
|
||||||
insmnum = comp_mod(insmnum, permmnum);
|
insmnum = comp_mod(insmnum, permmnum);
|
||||||
for (minfo.group = amatches;
|
for (minfo.group = amatches;
|
||||||
minfo.group && (c += (minfo.group)->mcount) <= insmnum;
|
minfo.group && (minfo.group)->mcount <= insmnum;
|
||||||
minfo.group = (minfo.group)->next)
|
minfo.group = (minfo.group)->next)
|
||||||
insmnum -= (minfo.group)->mcount;
|
insmnum -= (minfo.group)->mcount;
|
||||||
if (!minfo.group) {
|
if (!minfo.group) {
|
||||||
|
|
Loading…
Reference in a new issue