zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <A.Main@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: ZLE scrolly bugfix
Date: Wed, 17 Jul 1996 12:17:23 +0100 (BST)	[thread overview]
Message-ID: <7795.199607171117@stone.dcs.warwick.ac.uk> (raw)

-----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-----



             reply	other threads:[~1996-07-17 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-17 11:17 Zefram [this message]
1996-07-17 18:38 ` Geoff Wing
1996-07-17 18:56   ` Zefram
1996-07-18  9:20     ` Geoff Wing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7795.199607171117@stone.dcs.warwick.ac.uk \
    --to=a.main@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).