zsh-workers
 help / color / mirror / code / Atom feed
* ZLE scrolly bugfix
@ 1996-07-17 11:17 Zefram
  1996-07-17 18:38 ` Geoff Wing
  0 siblings, 1 reply; 4+ messages in thread
From: Zefram @ 1996-07-17 11:17 UTC (permalink / raw)
  To: Z Shell workers mailing list

-----BEGIN PGP SIGNED MESSAGE-----

This patch fixes a couple of problems in the new refresh code.
If the cursor gets onto the last line of the screen and there's
more text off the bottom of the screen, it's possible to have the
cursor over the <.... marker when it's really in the text hidden
under that.  Also, the cursor doesn't go onto the last position on
the screen properly on a terminal that moves the cursor onto the
next line as soon as something is written to the last column.

I fix both of these problems by having refresh() avoid putting
the cursor on the last line if possible.  If there's no more text,
obviously, it can't avoid putting the cursor there, but then it's
not a problem.

 -zefram

      Index: Src/zle_refresh.c
      ===================================================================
      RCS file: /home/zefram/usr/cvsroot/zsh/Src/zle_refresh.c,v
      retrieving revision 1.6
      diff -c -r1.6 zle_refresh.c
      *** zle_refresh.c	1996/07/16 14:27:04	1.6
      --- zle_refresh.c	1996/07/17 09:54:46
      ***************
      *** 148,158 ****
        {						\
            *s = '\0';					\
            if (++ln == winh)				\
      ! 	if (nvln != -1) {			\
      ! 	    ln--;		/* too eager */	\
        	    break;				\
      ! 	} else 					\
        	    ln = scrollwindow(0);		\
            if (!nbuf[ln])				\
        	nbuf[ln] = (char *)zalloc(winw + 1);	\
            s = (unsigned char *)nbuf[ln];		\
      --- 148,160 ----
        {						\
            *s = '\0';					\
            if (++ln == winh)				\
      ! 	if (nvln != --ln && nvln != -1)		\
        	    break;				\
      ! 	else {					\
        	    ln = scrollwindow(0);		\
      + 	    if(nvln != -1)			\
      + 		nvln -= winh - ln;		\
      + 	}					\
            if (!nbuf[ln])				\
        	nbuf[ln] = (char *)zalloc(winw + 1);	\
            s = (unsigned char *)nbuf[ln];		\
      ***************
      *** 599,606 ****
        
        	/* deleting characters - see if we can find a match series that
        	   makes it cheaper to delete intermediate characters
      ! 	   eg. oldline: hifoobar } hopefully cheaper here to delete two
      ! 	       newline: foobar	 } characters, then we have six matches */
        
        	    if (tccan(TCDEL) && nl[1] && ol[1] && (ol[1] != nl[1])) {
        		for (i = 0, p1 = ol; *p1; p1++, i++)
      --- 601,608 ----
        
        	/* deleting characters - see if we can find a match series that
        	   makes it cheaper to delete intermediate characters
      ! 	   eg. oldline: hifoobar \ hopefully cheaper here to delete two
      ! 	       newline: foobar	 / characters, then we have six matches */
        
        	    if (tccan(TCDEL) && nl[1] && ol[1] && (ol[1] != nl[1])) {
        		for (i = 0, p1 = ol; *p1; p1++, i++)

Part of this patch was brought to you by the Campaign for Real Braces[tm].

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMey6x3D/+HJTpU/hAQHZGQQAm30xD+zwAG0ZBw9GJB8H6jf86cBwZrPC
gfrI3vAsVd2wpkWPqMmzkO0brqtjqOfrqVEsCjMFe1Fkgk3O3mh8Wp1S40z7xWfS
7WphIk49qoqA4cGDsxZTdgCFWWsnq7IE4DedMfRLEsny0ex34kwdmc4xptMf/D5S
bQQqREBbUXQ=
=np0q
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-07-18  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-17 11:17 ZLE scrolly bugfix Zefram
1996-07-17 18:38 ` Geoff Wing
1996-07-17 18:56   ` Zefram
1996-07-18  9:20     ` Geoff Wing

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).