diff options
author | nicm <nicm> | 2016-11-16 13:31:22 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-11-16 13:31:22 +0000 |
commit | ddf7ac5ae4d044cda12d959bbf02df921f9d84a5 (patch) | |
tree | 28c98c2fb9d8af7f725be27b760add01281ad21a /tty.c | |
parent | a8e2d851feba7934d500520946ab5e366b6dfe90 (diff) |
Fix calculation of whether we need a region for drawing a cell (only if
full width and at the edge of the region), otherwise clear the region entirely.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1004,7 +1004,7 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx) * off the edge - if so, move the cursor back to the right. */ if (ctx->xoff + ctx->ocx > tty->rright) - tty_cursor(tty, tty->rright, ctx->yoff + ctx->ocy); + tty_cursor(tty, tty->rright, tty->rlower); else tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); @@ -1134,8 +1134,12 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) struct screen *s = wp->screen; u_int cx, width; - if (ctx->ocy == ctx->orlower) + if (ctx->xoff + ctx->ocx > tty->sx - 1 && + ctx->yoff + ctx->ocy == ctx->orlower && + tty_pane_full_width(tty, ctx)) tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); + else + tty_region_off(tty); tty_margin_off(tty); /* Is the cursor in the very last position? */ |