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

Re: Minor refresh problem with completion



I wrote:

> Andrej Borsenkow wrote:
> 
> > I have a feeling, that with new completion the complete line is refreshed
> > every time. I noted that, as my display flickers sometimes quite ugly. It's
> > getting worse, when logical line extends over several terminal lines ...
> > Anybody else seen it?
> 
> That's not restricted to the new completion. It's caused by the way
> `clearlist' (the variable that triggers clearing a list that may be
> beneath the prompt) works -- it forces a redisplay of the prompt.
> 
> I tried to do this in a more sophisticated way (moving the cursor
> under the prompt, clear to EOD, move cursor up), but couldn't get it
> to work with the rest of the redisplay code. I'm not one of the most
> knowledgeable persons with respect to the zle redisplay code, so I
> have to ask: can someone come up with a better imlpementation?

Of course, now that I tried it again, it seems to work (at least if
your terminal has the capability of clearing to EOD).

But still, Id' be glad if our refresh-code experts could have a look
at this, because the code now sets the cursor to the last column of
the last prompt line and gives out a TCCLEAREOD -- and doing that when 
not in the first column may be undefined on some terminals if I
remember correctly.

Bye
 Sven

diff -u oos/Zle/zle_refresh.c Src/Zle/zle_refresh.c
--- oos/Zle/zle_refresh.c	Mon Mar 29 10:36:48 1999
+++ Src/Zle/zle_refresh.c	Mon Mar 29 10:41:47 1999
@@ -254,10 +254,18 @@
 	return;
 
     if (clearlist) {
-	invalidatelist();
-	moveto(0, 0);
-	clearflag = 0;
-	resetneeded = 1;
+	if (tccan(TCCLEAREOD)) {
+	    int ovln = vln, ovcs = vcs;
+
+	    moveto(nlnct - 1, columns - 1);
+	    tcout(TCCLEAREOD);
+	    moveto(ovln, ovcs);
+	} else {
+	    invalidatelist();
+	    moveto(0, 0);
+	    clearflag = 0;
+	    resetneeded = 1;
+	}
 	clearlist = 0;
     }
 #ifdef HAVE_SELECT

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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