Make subwindows scroll correctly.
This commit is contained in:
parent
95dd4d0f2c
commit
3dda981dc7
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: id_subwins.c,v 1.11 2000/04/15 13:17:03 blymn Exp $ */
|
||||
/* $NetBSD: id_subwins.c,v 1.12 2000/04/16 05:48:25 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1981, 1993, 1994
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)id_subwins.c 8.2 (Berkeley) 5/4/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: id_subwins.c,v 1.11 2000/04/15 13:17:03 blymn Exp $");
|
||||
__RCSID("$NetBSD: id_subwins.c,v 1.12 2000/04/16 05:48:25 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -53,20 +53,12 @@ void
|
||||
__id_subwins(WINDOW *orig)
|
||||
{
|
||||
WINDOW *win;
|
||||
int oy, realy, y;
|
||||
int oy, y;
|
||||
|
||||
realy = orig->begy + orig->cury;
|
||||
for (win = orig->nextp; win != orig; win = win->nextp) {
|
||||
/*
|
||||
* If the window ends before our current position, don't need
|
||||
* to do anything.
|
||||
*/
|
||||
if (win->begy + win->maxy <= realy)
|
||||
continue;
|
||||
|
||||
oy = orig->cury;
|
||||
for (y = realy - win->begy; y < win->maxy; y++, oy++)
|
||||
oy = win->begy - orig->begy;
|
||||
for (y = 0; y < win->maxy; y++)
|
||||
win->lines[y]->line =
|
||||
&orig->lines[oy]->line[win->ch_off];
|
||||
&orig->lines[oy + y]->line[win->ch_off];
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: insdelln.c,v 1.3 2000/04/15 13:17:04 blymn Exp $ */
|
||||
/* $NetBSD: insdelln.c,v 1.4 2000/04/16 05:48:25 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -132,6 +132,6 @@ winsdelln(WINDOW *win, int lines)
|
||||
__touchline(win, y, 0, (int) win->maxx - 1, 0);
|
||||
}
|
||||
if (win->orig != NULL)
|
||||
__id_subwins(win);
|
||||
__id_subwins(win->orig);
|
||||
return (OK);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: newwin.c,v 1.17 2000/04/15 22:53:46 jdc Exp $ */
|
||||
/* $NetBSD: newwin.c,v 1.18 2000/04/16 05:48:25 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1981, 1993, 1994
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: newwin.c,v 1.17 2000/04/15 22:53:46 jdc Exp $");
|
||||
__RCSID("$NetBSD: newwin.c,v 1.18 2000/04/16 05:48:25 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -141,7 +141,7 @@ __set_subwin(WINDOW *orig, WINDOW *win)
|
||||
for (lp = win->lspace, i = 0; i < win->maxy; i++, lp++) {
|
||||
win->lines[i] = lp;
|
||||
olp = orig->lines[i + win->begy - orig->begy];
|
||||
lp->line = &olp->line[win->begx - orig->begx];
|
||||
lp->line = &olp->line[win->ch_off];
|
||||
lp->firstchp = &olp->firstch;
|
||||
lp->lastchp = &olp->lastch;
|
||||
lp->hash = __hash((char *)(void *)lp->line,
|
||||
|
Loading…
Reference in New Issue
Block a user