mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-24 04:50:27 +02:00
zsh-workers/9458
This commit is contained in:
parent
5ce459243f
commit
17ef03b99b
2 changed files with 44 additions and 19 deletions
|
|
@ -1026,7 +1026,7 @@ makecompparams(void)
|
|||
|
||||
comprpms[CPN_COMPSTATE] = cpm;
|
||||
tht = paramtab;
|
||||
cpm->level = locallevel;
|
||||
cpm->level = locallevel + 1;
|
||||
cpm->gets.hfn = get_compstate;
|
||||
cpm->sets.hfn = set_compstate;
|
||||
cpm->unsetfn = compunsetfn;
|
||||
|
|
@ -1146,8 +1146,24 @@ compunsetfn(Param pm, int exp)
|
|||
}
|
||||
}
|
||||
} else if (PM_TYPE(pm->flags) == PM_HASHED) {
|
||||
Param *p;
|
||||
int i;
|
||||
|
||||
deletehashtable(pm->u.hash);
|
||||
pm->u.hash = NULL;
|
||||
|
||||
for (p = compkpms, i = CP_KEYPARAMS; i--; p++)
|
||||
*p = NULL;
|
||||
}
|
||||
if (!exp) {
|
||||
Param *p;
|
||||
int i;
|
||||
|
||||
for (p = comprpms, i = CP_REALPARAMS; i; p++, i--)
|
||||
if (*p == pm) {
|
||||
*p = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1159,18 +1175,22 @@ comp_setunset(int rset, int runset, int kset, int kunset)
|
|||
|
||||
if (comprpms && (rset >= 0 || runset >= 0)) {
|
||||
for (p = comprpms; rset || runset; rset >>= 1, runset >>= 1, p++) {
|
||||
if (rset & 1)
|
||||
(*p)->flags &= ~PM_UNSET;
|
||||
if (runset & 1)
|
||||
(*p)->flags |= PM_UNSET;
|
||||
if (*p) {
|
||||
if (rset & 1)
|
||||
(*p)->flags &= ~PM_UNSET;
|
||||
if (runset & 1)
|
||||
(*p)->flags |= PM_UNSET;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (comprpms && (kset >= 0 || kunset >= 0)) {
|
||||
if (compkpms && (kset >= 0 || kunset >= 0)) {
|
||||
for (p = compkpms; kset || kunset; kset >>= 1, kunset >>= 1, p++) {
|
||||
if (kset & 1)
|
||||
(*p)->flags &= ~PM_UNSET;
|
||||
if (kunset & 1)
|
||||
(*p)->flags |= PM_UNSET;
|
||||
if (*p) {
|
||||
if (kset & 1)
|
||||
(*p)->flags &= ~PM_UNSET;
|
||||
if (kunset & 1)
|
||||
(*p)->flags |= PM_UNSET;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1828,19 +1828,24 @@ int
|
|||
list_matches(Hookdef dummy, void *dummy2)
|
||||
{
|
||||
struct chdata dat;
|
||||
int ret;
|
||||
|
||||
HEAPALLOC {
|
||||
#ifdef DEBUG
|
||||
/* Sanity check */
|
||||
if (!validlist) {
|
||||
showmsg("BUG: listmatches called with bogus list");
|
||||
return 1;
|
||||
}
|
||||
/* Sanity check */
|
||||
if (!validlist) {
|
||||
showmsg("BUG: listmatches called with bogus list");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
dat.matches = amatches;
|
||||
dat.num = nmatches;
|
||||
dat.cur = NULL;
|
||||
return runhookdef(COMPLISTMATCHESHOOK, (void *) &dat);
|
||||
dat.matches = amatches;
|
||||
dat.num = nmatches;
|
||||
dat.cur = NULL;
|
||||
ret = runhookdef(COMPLISTMATCHESHOOK, (void *) &dat);
|
||||
} LASTALLOC;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Invalidate the completion list. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue