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

RE: Menu-selection screen refresh slowness



I wrote:

> ...
> 
> I just noted this myself, sorry. The code for some of the keys doesn't
> set up the variables we need for the optimisation. We have to disable
> the faster display code for them (for now, I'll have a look at what we
> can do to improve the code). Unfortunately, we have to disable it even
> for TAB.

This allows to use it for some more keys again, including TAB.


Bart Schaefer wrote:

> ...
> 
> This is *vastly* improved now, thanks, Sven.  Can we get this into 4.0.5?

One problem is that this relies on 17195. I'll have a look if it can
be added.


Bye
  Sven

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.48
diff -u -r1.48 complist.c
--- Src/Zle/complist.c	24 May 2002 15:02:42 -0000	1.48
+++ Src/Zle/complist.c	27 May 2002 07:36:46 -0000
@@ -1571,6 +1571,8 @@
 static int
 complistmatches(Hookdef dummy, Chdata dat)
 {
+    static int onlnct = -1;
+
     Cmgroup oamatches = amatches;
 
     amatches = dat->matches;
@@ -1650,11 +1652,12 @@
     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 @@
 		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 @@
 		break;
 	    }
 	    setwish = 1;
-            molbeg = -42;
 	    continue;
 	} else if (cmd == Th(z_undo)) {
 	    int l;
@@ -2327,7 +2331,6 @@
 	    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 @@
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
 	    mline = -1;
-            molbeg = -42;
 	    continue;
 	} else if (cmd == Th(z_undefinedkey)) {
 	    continue;

-- 
Sven Wischnowsky                          wischnow@xxxxxxxxx



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