diff options
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r-- | Src/Zle/zle_main.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 515405a0d..2c0d3655e 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -443,9 +443,9 @@ zleread(char *lp, char *rp, int ha) insmode = unset(OVERSTRIKE); eofsent = 0; resetneeded = 0; - lpptbuf = promptexpand(lp, 1, NULL, NULL); + lpromptbuf = promptexpand(lp, 1, NULL, NULL); pmpt_attr = txtchange; - rpptbuf = promptexpand(rp, 1, NULL, NULL); + rpromptbuf = promptexpand(rp, 1, NULL, NULL); rpmpt_attr = txtchange; histallowed = ha; PERMALLOC { @@ -529,8 +529,8 @@ zleread(char *lp, char *rp, int ha) statusline = NULL; invalidatelist(); trashzle(); - free(lpptbuf); - free(rpptbuf); + free(lpromptbuf); + free(rpromptbuf); zleactive = 0; alarm(0); } LASTALLOC; @@ -565,13 +565,14 @@ execzlefunc(Thingy func) showmsg(msg); zsfree(msg); feep(); - } else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_COMP)) { + } else if((w = func->widget)->flags & + (WIDGET_INT|WIDGET_COMP | WIDGET_NCOMP)) { int wflags = w->flags; if(!(wflags & ZLE_KEEPSUFFIX)) removesuffix(); if(!(wflags & ZLE_MENUCMP) || - ((wflags & WIDGET_COMP) && compwidget != w)) { + ((wflags & (WIDGET_COMP|WIDGET_NCOMP)) && compwidget != w)) { /* If we are doing a special completion, and the widget * is not the one currently in use for special completion, * we are starting a new completion. @@ -586,6 +587,9 @@ execzlefunc(Thingy func) if (wflags & WIDGET_COMP) { compwidget = w; completespecial(); + } else if (wflags & WIDGET_NCOMP) { + compwidget = w; + completecall(); } else w->u.fn(); if (!(wflags & ZLE_NOTCOMMAND)) @@ -855,7 +859,7 @@ trashzle(void) static struct builtin bintab[] = { BUILTIN("bindkey", 0, bin_bindkey, 0, -1, 0, "evaMldDANmrsLR", NULL), BUILTIN("vared", 0, bin_vared, 1, 7, 0, NULL, NULL), - BUILTIN("zle", 0, bin_zle, 0, -1, 0, "lDANCLmMgG", NULL), + BUILTIN("zle", 0, bin_zle, 0, -1, 0, "lDANCLmMgGc", NULL), }; /**/ @@ -869,6 +873,11 @@ setup_zle(Module m) spaceinlineptr = spaceinline; zlereadptr = zleread; + addmatchesptr = addmatches; + comp_strptr = comp_str; + getcpatptr = getcpat; + makecomplistcallptr = makecomplistcall; + /* initialise the thingies */ init_thingies(); @@ -931,6 +940,11 @@ finish_zle(Module m) spaceinlineptr = noop_function_int; zlereadptr = fallback_zleread; + addmatchesptr = NULL; + comp_strptr = NULL; + getcpatptr = NULL; + makecomplistcallptr = NULL; + return 0; } |