summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-03 23:26:56 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-03 23:26:56 +0000
commitebe07c27260c295256e7c66480057a3fcfdc9e7f (patch)
tree159568b6b28e77a6f5496e54f7463f706d1810d6 /screen-write.c
parent3f16fcb30ab9865cb5cddb215da34842e1b8b5fe (diff)
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.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen-write.c b/screen-write.c
index b57b0620..033a1a52 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -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);
}