diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-25 15:50:48 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-25 15:50:48 +0000 |
commit | 49477de55c8578ac7eac265c1557f47c6107940d (patch) | |
tree | 5f076c209a531069a0371383025ccf6647693cd8 | |
parent | dff949747c6c060cb2970d2d183ef69d25066abd (diff) | |
download | rtmux-49477de55c8578ac7eac265c1557f47c6107940d.tar.gz rtmux-49477de55c8578ac7eac265c1557f47c6107940d.tar.bz2 rtmux-49477de55c8578ac7eac265c1557f47c6107940d.zip |
Fix some miscalculations when clearing to start of screen: the number of lines
to the cursor is cy not cy - 1, and the current cursor cell should be included.
-rw-r--r-- | screen-write.c | 6 | ||||
-rw-r--r-- | tty.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/screen-write.c b/screen-write.c index 118a6bad..3e45e497 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.3 2009/06/03 16:54:26 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.4 2009/06/03 23:26:56 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -605,11 +605,11 @@ screen_write_clearstartofscreen(struct screen_write_ctx *ctx) sx = screen_size_x(s); if (s->cy > 0) - grid_view_clear(s->grid, 0, 0, sx, s->cy - 1); + grid_view_clear(s->grid, 0, 0, sx, s->cy); if (s->cx > sx - 1) grid_view_clear(s->grid, 0, s->cy, sx, 1); else - grid_view_clear(s->grid, 0, s->cy, s->cx, 1); + grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1); tty_write_cmd(ctx->wp, TTY_CLEARSTARTOFSCREEN); } @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.100 2009-06-24 17:31:03 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.3 2009/06/03 23:26:56 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -807,7 +807,7 @@ tty_cmd_clearstartofscreen( tty_putc(tty, ' '); } } - for (i = 0; i < s->old_cx; i++) + for (i = 0; i <= s->old_cx; i++) tty_putc(tty, ' '); } |