From d28f67623f03ec9905e2e3f10b2f3dd7f61956ca Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 26 Jun 2002 11:07:42 +0000 Subject: two new modes for menu selection: incremental search and interactive (17366) --- Src/Zle/compresult.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Src/Zle/compresult.c') diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index 5d06538ac..75d934a02 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -744,8 +744,9 @@ do_ambiguous(void) * unambiguous prefix. */ lastambig = 1; - if (usemenu || (haspattern && comppatinsert && - !strcmp(comppatinsert, "menu"))) { + if (iforcemenu != -1 && + (usemenu || (haspattern && comppatinsert && + !strcmp(comppatinsert, "menu")))) { /* We are in a position to start using menu completion due to one * * of the menu completion options, or due to the menu-complete- * * word command, or due to using GLOB_COMPLETE which does menu- * @@ -961,9 +962,10 @@ do_single(Cmatch m) cs = minfo.pos; foredel(l); - if (m->flags & CMF_ALL) + if (m->flags & CMF_ALL) { do_allmatches(0); - else { + return; + } /* And then we insert the new string. */ minfo.len = instmatch(m, &scs); @@ -1136,7 +1138,6 @@ do_single(Cmatch m) runhookdef(INSERTMATCHHOOK, (void *) &dat); minfo.cur = om; } - } } /* Do completion, given that we are in the middle of a menu completion. We * @@ -1283,6 +1284,9 @@ do_ambig_menu(void) { Cmatch *mc; + if (iforcemenu == -1) + do_ambiguous(); + if (usemenu != 3) { menucmp = 1; menuacc = 0; @@ -1324,7 +1328,8 @@ do_ambig_menu(void) } #endif mc = (minfo.group)->matches + insmnum; - do_single(*mc); + if (iforcemenu != -1) + do_single(*mc); minfo.cur = mc; } -- cgit 1.4.1