summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Safiullin <form@cvs.openbsd.org>2002-06-20 06:13:57 +0000
committerOleg Safiullin <form@cvs.openbsd.org>2002-06-20 06:13:57 +0000
commit348f1df9900b73279e5c48d80ae0303dcd96bcf3 (patch)
tree41b9637084257f8a7fc351072b3cf9f2c8a6b825
parent94ec2579eb69d9b2267543062027b0cc88a8ab33 (diff)
scrolling support.
ok millert@
-rw-r--r--usr.bin/talk/display.c13
-rw-r--r--usr.bin/talk/init_disp.c8
2 files changed, 10 insertions, 11 deletions
diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c
index 4e7d6875fd5..4963e14cf85 100644
--- a/usr.bin/talk/display.c
+++ b/usr.bin/talk/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.9 2001/11/19 19:02:16 mpech Exp $ */
+/* $OpenBSD: display.c,v 1.10 2002/06/20 06:13:56 form Exp $ */
/* $NetBSD: display.c,v 1.3 1994/12/09 02:14:13 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: display.c,v 1.9 2001/11/19 19:02:16 mpech Exp $";
+static char rcsid[] = "$OpenBSD: display.c,v 1.10 2002/06/20 06:13:56 form Exp $";
#endif /* not lint */
/*
@@ -200,11 +200,10 @@ xscroll(win, flag)
win->x_col = 0;
return;
}
- win->x_line = (win->x_line + 1) % win->x_nlines;
win->x_col = 0;
- wmove(win->x_win, win->x_line, win->x_col);
- wclrtoeol(win->x_win);
- wmove(win->x_win, (win->x_line + 1) % win->x_nlines, win->x_col);
- wclrtoeol(win->x_win);
+ if (++win->x_line == win->x_nlines) {
+ --win->x_line;
+ scroll(win->x_win);
+ }
wmove(win->x_win, win->x_line, win->x_col);
}
diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c
index 3ad5114be47..c4c1c4e71e9 100644
--- a/usr.bin/talk/init_disp.c
+++ b/usr.bin/talk/init_disp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_disp.c,v 1.11 2000/06/30 16:00:21 millert Exp $ */
+/* $OpenBSD: init_disp.c,v 1.12 2002/06/20 06:13:56 form Exp $ */
/* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
-static char rcsid[] = "$OpenBSD: init_disp.c,v 1.11 2000/06/30 16:00:21 millert Exp $";
+static char rcsid[] = "$OpenBSD: init_disp.c,v 1.12 2002/06/20 06:13:56 form Exp $";
#endif /* not lint */
/*
@@ -79,14 +79,14 @@ init_display()
my_win.x_nlines = LINES / 2;
my_win.x_ncols = COLS;
my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 0, 0);
- scrollok(my_win.x_win, FALSE);
+ scrollok(my_win.x_win, TRUE);
wclear(my_win.x_win);
his_win.x_nlines = LINES / 2 - 1;
his_win.x_ncols = COLS;
his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols,
my_win.x_nlines+1, 0);
- scrollok(his_win.x_win, FALSE);
+ scrollok(his_win.x_win, TRUE);
wclear(his_win.x_win);
line_win = newwin(1, COLS, my_win.x_nlines, 0);