summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-11-16 13:31:22 +0000
committernicm <nicm@openbsd.org>2016-11-16 13:31:22 +0000
commit5bb1549cb0a956f20213028eada507c70f850e30 (patch)
tree092c74aa04f8b5ca5f5f5fea9cfc6369c54effe8 /usr.bin/tmux/tty.c
parentBring icmp6_mtudisc_clone() in line with icmp_mtudisc_clone(). The (diff)
downloadwireguard-openbsd-5bb1549cb0a956f20213028eada507c70f850e30.tar.xz
wireguard-openbsd-5bb1549cb0a956f20213028eada507c70f850e30.zip
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 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 27873d7d091..b23b3285c70 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.214 2016/11/15 15:17:28 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.215 2016/11/16 13:31:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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? */