summaryrefslogtreecommitdiff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-06-26 11:07:42 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-06-26 11:07:42 +0000
commitd28f67623f03ec9905e2e3f10b2f3dd7f61956ca (patch)
tree16c5640d9568a2b6d091f84d6c4b40f738efede0 /Src/Zle/compresult.c
parent03105a5d6e148754606df7e654e98cce07ae00ac (diff)
downloadzsh-d28f67623f03ec9905e2e3f10b2f3dd7f61956ca.tar.gz
zsh-d28f67623f03ec9905e2e3f10b2f3dd7f61956ca.zip
two new modes for menu selection: incremental search and interactive (17366)
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c17
1 files changed, 11 insertions, 6 deletions
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;
}