diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-06-02 20:51:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-06-02 20:51:47 +0000 |
commit | 3f157bc466d021893f9144e42360e354926875ba (patch) | |
tree | 1a8a73992c6289aeb552e2e186c7e8fb1c237b33 /usr.bin/tmux/tty.c | |
parent | 501f8883d2d4fc63891cacf57efb2b92e9d523fe (diff) |
Move the code to set up a padding cell into grid.c.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index f3e0de7ac74..1dd4e009d45 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.380 2020/05/24 09:13:06 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.381 2020/06/02 20:51:46 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1380,9 +1380,10 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx, screen_select_cell(s, &last, gcp); else memcpy(&last, gcp, sizeof last); - if (!tty_check_overlay(tty, atx + ux, aty)) - ux += gcp->data.width; - else if (ux + gcp->data.width > nx) { + if (!tty_check_overlay(tty, atx + ux, aty)) { + if (~gcp->flags & GRID_FLAG_PADDING) + ux += gcp->data.width; + } else if (ux + gcp->data.width > nx) { tty_attributes(tty, &last, defaults, palette); tty_cursor(tty, atx + ux, aty); for (j = 0; j < gcp->data.width; j++) { @@ -1397,7 +1398,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx, for (j = 0; j < gcp->data.size; j++) tty_putc(tty, gcp->data.data[j]); ux += gcp->data.width; - } else { + } else if (~gcp->flags & GRID_FLAG_PADDING) { memcpy(buf + len, gcp->data.data, gcp->data.size); len += gcp->data.size; width += gcp->data.width; |