summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/compcore.c7
-rw-r--r--Src/Zle/complist.c8
-rw-r--r--Src/Zle/compresult.c2
4 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e02ea560b..be8da7772 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-06-28  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12093: Src/Zle/compcore.c, Src/Zle/complist.c, Src/Zle/compresult.c:
+ 	make a-a-i-n-h in menu selection work with one match; better undo
+ 	behaviour for menu selection
+	
 2000-06-27  Bart Schaefer  <schaefer@brasslantern.com>
 
 	* 12086: Doc/Zsh/compsys.yo: Move _use_lo doc into alphabetical
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index ad87fe619..895267535 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -37,7 +37,7 @@ static Widget lastcompwidget;
 /* Flags saying what we have to do with the result. */
 
 /**/
-int useexact, useline, uselist, forcelist, startauto;
+int useexact, useline, uselist, forcelist, iforcemenu, startauto;
 
 /* Non-zero if we should go back to the last prompt. */
 
@@ -349,7 +349,10 @@ do_completion(Hookdef dummy, Compldat dat)
 
     if (comppatmatch && *comppatmatch && comppatmatch != opm)
 	haspattern = 1;
-    if (useline < 0)
+    if (iforcemenu) {
+	do_ambig_menu();
+	ret = 0;
+    } else if (useline < 0)
 	ret = selfinsert(zlenoargs);
     else if (!useline && uselist) {
 	/* All this and the guy only wants to see the list, sigh. */
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 75a23f0e5..9159326f3 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1782,11 +1782,15 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    menucmp = menuacc = hasoldlist = 0;
 	    minfo.cur = NULL;
 	    fixsuffix();
+	    handleundo();
 	    validlist = 0;
 	    amatches = pmatches = lastmatches = NULL;
 	    invalidate_list();
+	    iforcemenu = 1;
 	    menucomplete(zlenoargs);
-	    if (dat->num < 2 || !minfo.cur || !*(minfo.cur)) {
+	    iforcemenu = 0;
+
+	    if (dat->num < 1 || !minfo.cur || !*(minfo.cur)) {
 		noselect = clearlist = listshown = 1;
 		onlyexpl = 0;
 		zrefresh();
@@ -1821,6 +1825,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    s->origcs = origcs;
 	    s->origll = origll;
 	    accept_last();
+	    handleundo();
 	    do_menucmp(0);
 	    mselect = (*(minfo.cur))->gnum;
 
@@ -1852,6 +1857,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    if (!u)
 		break;
 
+	    handleundo();
 	    cs = 0;
 	    foredel(ll);
 	    spaceinline(l = strlen(u->line));
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 092971479..19d785bb8 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1093,7 +1093,7 @@ comp_mod(int v, int m)
 /* This handles the beginning of menu-completion. */
 
 /**/
-static void
+void
 do_ambig_menu(void)
 {
     Cmatch *mc;