summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-05-11 11:38:49 +0000
committernicm <nicm@openbsd.org>2017-05-11 11:38:49 +0000
commit1bf2addf6c1b1a7fb0513031aa699a949e021450 (patch)
treea67f7a07b611b127e7f2a84e29bcb9d796e99408 /usr.bin/tmux/tty.c
parentFix white spaces and wrap long line. No binary change. (diff)
downloadwireguard-openbsd-1bf2addf6c1b1a7fb0513031aa699a949e021450.tar.xz
wireguard-openbsd-1bf2addf6c1b1a7fb0513031aa699a949e021450.zip
Need to redraw out to cellsize (total cells used in a line) rather than
cellused (only non-space cells) because there may be cells with a nondefault background.
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 9f954ccf50a..ed5eec293fa 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.272 2017/05/10 18:40:13 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.273 2017/05/11 11:38:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -846,9 +846,13 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
tty_region_off(tty);
tty_margin_off(tty);
+ /*
+ * Clamp the width to cellsize - note this is not cellused, because
+ * there may be empty background cells after it (from BCE).
+ */
sx = screen_size_x(s);
- if (sx > s->grid->linedata[s->grid->hsize + py].cellused)
- sx = s->grid->linedata[s->grid->hsize + py].cellused;
+ if (sx > s->grid->linedata[s->grid->hsize + py].cellsize)
+ sx = s->grid->linedata[s->grid->hsize + py].cellsize;
if (sx > tty->sx)
sx = tty->sx;