Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
ZLE scrolly bugfix
- X-seq: zsh-workers 1678
- From: Zefram <A.Main@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Z Shell workers mailing list)
- Subject: ZLE scrolly bugfix
- Date: Wed, 17 Jul 1996 12:17:23 +0100 (BST)
-----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-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author