about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/compcore.c12
-rw-r--r--Src/Zle/complist.c4
2 files changed, 13 insertions, 3 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 941023769..ee218e132 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -499,12 +499,22 @@ after_complete(Hookdef dummy, Compldat dat)
 {
     if (menucmp && !oldmenucmp) {
 	struct chdata dat;
+	int ret;
 
 	dat.matches = amatches;
 	dat.num = nmatches;
 	dat.cur = NULL;
-	if (runhookdef(MENUSTARTHOOK, (void *) &dat))
+	if ((ret = runhookdef(MENUSTARTHOOK, (void *) &dat))) {
 	    menucmp = menuacc = 0;
+	    if (ret == 2) {
+		cs = 0;
+		foredel(ll);
+		inststr(origline);
+		cs = origcs;
+		clearlist = 1;
+		invalidatelist();
+	    }
+	}
     }
     return 0;
 }
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 76fbaf58b..fdda07112 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -2135,7 +2135,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 	showinglist = -2;
 	minfo.asked = 0;
     }
-    if (!noselect) {
+    if (!noselect && (!dat || acc)) {
 	showinglist = -2;
 	onlyexpl = oe;
 	if (!smatches)
@@ -2145,7 +2145,7 @@ domenuselect(Hookdef dummy, Chdata dat)
     mlbeg = -1;
     fdat = NULL;
 
-    return (!noselect ^ acc);
+    return (dat ? (acc ? 1 : 2) : (!noselect ^ acc));
 }
 
 /* The widget function. */