Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 3.1.5-pws-16: alwayslastprompt doesn't always when completing at M-x



Bart Schaefer wrote:

> Freshly-compiled -pws-16, plus Sven's several patches from this week; setopt
> output included for reference, the meat is beyond it.  Short descript is,
> IF the first time you use completion is for zle commands following ESC-x,
> alwayslastprompt seems to be ignored.  It kicks in when using completion for
> files, and thereafter applies to M-x as well.

Ahem. This was because listmatches() now uses complastprompt instead
of testint ALWAYSLASTPROMPT directly and I forgot to set that in
listlist().

This should fix it. Just for the fun of it I also made a interrupted 
M-x re-display a list of matches if there were one (`ls zsh<TAB><M-x><C-g>'
and the list is back again). Good?

Bye
 Sven

diff -u os/Zle/zle_misc.c Src/Zle/zle_misc.c
--- os/Zle/zle_misc.c	Wed Apr 28 16:24:01 1999
+++ Src/Zle/zle_misc.c	Thu Apr 29 09:19:49 1999
@@ -611,7 +611,7 @@
 executenamedcommand(char *prmt)
 {
     Thingy cmd;
-    int len, l = strlen(prmt);
+    int len, l = strlen(prmt), ols = listshown;
     char *ptr;
     char *okeymap = curkeymapname;
 
@@ -629,6 +629,10 @@
 	if (!(cmd = getkeycmd()) || cmd == Th(z_sendbreak)) {
 	    statusline = NULL;
 	    selectkeymap(okeymap, 1);
+	    if ((listshown = ols))
+		showinglist = -2;
+	    else
+		clearlist = 1;
 	    return NULL;
 	}
 	if(cmd == Th(z_clearscreen)) {
@@ -669,6 +673,10 @@
 		    unrefthingy(r);
 		    statusline = NULL;
 		    selectkeymap(okeymap, 1);
+		    if ((listshown = ols))
+			showinglist = -2;
+		    else
+			clearlist = 1;
 		    return r;
 		}
 		unrefthingy(r);
diff -u os/Zle/zle_refresh.c Src/Zle/zle_refresh.c
--- os/Zle/zle_refresh.c	Wed Apr 28 16:24:01 1999
+++ Src/Zle/zle_refresh.c	Thu Apr 29 09:12:30 1999
@@ -271,7 +271,7 @@
 	    clearflag = 0;
 	    resetneeded = 1;
 	}
-	listshown = 0;
+	listshown = showinglist = 0;
     }
     clearlist = 0;
 
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Wed Apr 28 16:24:02 1999
+++ Src/Zle/zle_tricky.c	Thu Apr 29 09:02:01 1999
@@ -7562,10 +7562,12 @@
     struct cmgroup dg;
     Cmgroup am = amatches;
     int vl = validlist, sm = smatches;
+    char *oclp = complastprompt;
 
     if (listshown)
 	showagain = 1;
 
+    complastprompt = ((zmult == 1) == !!isset(ALWAYSLASTPROMPT) ? "yes" : NULL);
     smatches = 1;
     validlist = 1;
     amatches = &dg;
@@ -7576,6 +7578,7 @@
     amatches = am;
     validlist = vl;
     smatches = sm;
+    complastprompt = oclp;
 }
 
 /* Expand the history references. */

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author