From 58ce2f119a42f115e9ed5c1b6a35e5837d4f6776 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 5 Nov 2016 00:34:43 +0100 Subject: 39829: when compstate[insert] is emptied by the completion function and AUTO_MENU is set, start menu completion on the second tab press rather than the third --- Src/Zle/compcore.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Src/Zle/compcore.c') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index fe16c1300..536bca7b3 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -835,6 +835,7 @@ callcompfunc(char *s, char *fn) endparamscope(); lastcmd = 0; incompfunc = icf; + startauto = 0; if (!complist) uselist = 0; @@ -882,8 +883,13 @@ callcompfunc(char *s, char *fn) useline = 1, usemenu = 1; else if (strpfx("auto", compinsert)) useline = 1, usemenu = 2; - else + else { useline = usemenu = 0; + /* if compstate[insert] was emptied, no unambiguous prefix + * ever gets inserted so allow the next tab to already start + * menu completion */ + startauto = lastambig = isset(AUTOMENU); + } if (useline && (p = strchr(compinsert, ':'))) { insmnum = atoi(++p); @@ -896,7 +902,7 @@ callcompfunc(char *s, char *fn) #endif } } - startauto = ((compinsert && + startauto = startauto || ((compinsert && !strcmp(compinsert, "automenu-unambiguous")) || (bashlistfirst && isset(AUTOMENU) && (!compinsert || !*compinsert))); -- cgit 1.4.1