summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-05-27 07:41:07 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-05-27 07:41:07 +0000
commitb36344b6ba9fe45fcf30638fdea6c2248e34fe10 (patch)
treedaa07e42946ded805074f1091095ba136402befa
parent189aa5c9f21969dfa2f157e25c126eb527e4d557 (diff)
downloadzsh-b36344b6ba9fe45fcf30638fdea6c2248e34fe10.tar.gz
zsh-b36344b6ba9fe45fcf30638fdea6c2248e34fe10.tar.xz
zsh-b36344b6ba9fe45fcf30638fdea6c2248e34fe10.zip
follow-up to 17222, make the optimisation work for some more keys again (17237)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/complist.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 19ba9b4bc..d96798c02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-27  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 17237: Src/Zle/complist.c: follow-up to 17222, make the
+	optimisation work for some more keys again
+
 2002-05-26  Clint Adams  <clint@zsh.org>
 
 	* 17235: Src/Modules/datetime.c, Src/Modules/datetime.mdd:
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 9eb1af8db..6d10a26ce 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1571,6 +1571,8 @@ singledraw()
 static int
 complistmatches(Hookdef dummy, Chdata dat)
 {
+    static int onlnct = -1;
+
     Cmgroup oamatches = amatches;
 
     amatches = dat->matches;
@@ -1650,11 +1652,12 @@ complistmatches(Hookdef dummy, Chdata dat)
     last_cap = (char *) zhalloc(max_caplen + 1);
     *last_cap = '\0';
 
-    if (mlbeg >= 0 && mlbeg == molbeg)
+    if (!mnew && onlnct == nlnct && mlbeg >= 0 && mlbeg == molbeg)
         singledraw();
     else if (!compprintlist(mselect >= 0) || !clearflag)
 	noselect = 1;
 
+    onlnct = nlnct;
     molbeg = mlbeg;
     mocol = mcol;
     moline = mline;
@@ -1769,8 +1772,10 @@ domenuselect(Hookdef dummy, Chdata dat)
 		for (x = mcols; x; x--, p++)
 		    if (*p && *p != mtexpl && **p && mselect == (**p)->gnum)
 			break;
-		if (x)
+		if (x) {
+                    mcol = mcols - x;
 		    break;
+                }
 	    }
 	    if (y < mlines)
 		mline = y;
@@ -1971,7 +1976,6 @@ domenuselect(Hookdef dummy, Chdata dat)
 		break;
 	    }
 	    setwish = 1;
-            molbeg = -42;
 	    continue;
 	} else if (cmd == Th(z_undo)) {
 	    int l;
@@ -2327,7 +2331,6 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
 	    mline = -1;
-            molbeg = -42;
 	    continue;
 	} else if (cmd == Th(z_reversemenucomplete) ||
 		   !strcmp(cmd->nam, "reverse-menu-complete")) {
@@ -2336,7 +2339,6 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
 	    mline = -1;
-            molbeg = -42;
 	    continue;
 	} else if (cmd == Th(z_undefinedkey)) {
 	    continue;