summaryrefslogtreecommitdiff
path: root/Src/Zle/compcore.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-11-05 00:34:43 +0100
committerOliver Kiddle <opk@zsh.org>2016-11-05 00:36:29 +0100
commit58ce2f119a42f115e9ed5c1b6a35e5837d4f6776 (patch)
tree41235619094d9bd4d872bc1a78249c728ce7e482 /Src/Zle/compcore.c
parent5c28031ea6f0095aa80afa56c3264c6cc5f36fbb (diff)
downloadzsh-58ce2f119a42f115e9ed5c1b6a35e5837d4f6776.tar.gz
zsh-58ce2f119a42f115e9ed5c1b6a35e5837d4f6776.zip
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
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c10
1 files changed, 8 insertions, 2 deletions
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)));