From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id VAA17180 for ; Wed, 17 Jul 1996 21:26:21 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id HAA14285; Wed, 17 Jul 1996 07:18:54 -0400 (EDT) Resent-Date: Wed, 17 Jul 1996 07:18:54 -0400 (EDT) From: Zefram Message-Id: <7795.199607171117@stone.dcs.warwick.ac.uk> Subject: ZLE scrolly bugfix To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Wed, 17 Jul 1996 12:17:23 +0100 (BST) X-Patch: 113 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]7822.35 X-US-Congress: Moronic fuckers MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"H78uV3.0.5V3.TmCxn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1678 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----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-----