about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-11 08:40:09 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-11 08:40:09 +0000
commitd3620a02dfad71562320a90315175855b44ed4de (patch)
treea664abfb6e766b8c6a87f76b3c42e6221372506f /Src/Zle
parented8b82b9b1bf74392caf4f4683f367bc4cbbd193 (diff)
downloadzsh-d3620a02dfad71562320a90315175855b44ed4de.tar.gz
zsh-d3620a02dfad71562320a90315175855b44ed4de.tar.xz
zsh-d3620a02dfad71562320a90315175855b44ed4de.zip
make ^G in menu-selection restore the old command line; add select=long* values for menu style to start menu-selection if list is too long for screen (11319)
Diffstat (limited to 'Src/Zle')
-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. */