From 1107e2f75fb17ced04271b933423e3e0ed0b3502 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 21 Sep 1999 01:31:11 +0000 Subject: zsh-workers/7947 --- Src/Zle/zle_tricky.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index e44f684c2..0d6127c6f 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -4609,6 +4609,48 @@ docompletion(char *s, int lst, int incmd) inststr(origline); cs = origcs; showinglist = -2; + } else if (useline == 2 && nmatches > 1) { + int first = 1, nm = nmatches; + Cmatch *mc; + + menucmp = 1; + menuacc = 0; + + for (minfo.group = amatches; + minfo.group && !(minfo.group)->mcount; + minfo.group = (minfo.group)->next); + + mc = (minfo.group)->matches; + + while (1) { + if (!first) + acceptlast(); + first = 0; + + if (!--nm) + menucmp = 0; + + do_single(*mc); + minfo.cur = mc; + + if (!*++(minfo.cur)) { + do { + if (!(minfo.group = (minfo.group)->next)) + break; + } while (!(minfo.group)->mcount); + if (!minfo.group) + break; + minfo.cur = minfo.group->matches; + } + mc = minfo.cur; + } + menucmp = 0; + minfo.cur = NULL; + + if (compforcelist && *compforcelist && uselist) + showinglist = -2; + else + invalidatelist(); } else if (useline) { /* We have matches. */ if (nmatches > 1) { @@ -4637,7 +4679,7 @@ docompletion(char *s, int lst, int incmd) } /* Print the explanation strings if needed. */ if (!showinglist && validlist && usemenu != 2 && nmatches != 1 && - (!oldlist || !listshown)) { + useline != 2 && (!oldlist || !listshown)) { Cmgroup g = amatches; Cexpl *e; int up = 0, tr = 1, nn = 0; @@ -4948,6 +4990,8 @@ callcompfunc(char *s, char *fn) else if (!strcmp(compinsert, "auto") || !strcmp(compinsert, "automenu")) useline = 1, usemenu = 2; + else if (!strcmp(compinsert, "all")) + useline = 2, usemenu = 0; else if (idigit(*compinsert)) { char *m; -- cgit 1.4.1