aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-06 06:01:18 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-06 06:01:18 +0100
commitacd70ea643d12368d4724a951f27a136228df993 (patch)
tree7c7750f2a703da820e85a9dfd42fd199282a74df /tty.c
parente3fa6cd96ceddb13be9e82e223123dc7f8a77f33 (diff)
parent950d3c5bbc99b68a353e78bbfe60933d60e3cf46 (diff)
downloadrtmux-acd70ea643d12368d4724a951f27a136228df993.tar.gz
rtmux-acd70ea643d12368d4724a951f27a136228df993.tar.bz2
rtmux-acd70ea643d12368d4724a951f27a136228df993.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/tty.c b/tty.c
index 425d3420..e0a3f6b6 100644
--- a/tty.c
+++ b/tty.c
@@ -1348,7 +1348,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
const struct grid_cell *gcp;
struct grid_line *gl;
struct client *c = tty->client;
- u_int i, j, ux, sx, width;
+ u_int i, j, ux, sx, width, hidden;
int flags, cleared = 0, wrapped = 0;
char buf[512];
size_t len;
@@ -1449,17 +1449,25 @@ 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)) {
+
+ hidden = 0;
+ for (j = 0; j < gcp->data.width; j++) {
+ if (!tty_check_overlay(tty, atx + ux + j, aty))
+ hidden++;
+ }
+ if (hidden != 0 && hidden == gcp->data.width) {
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++) {
- if (ux + j > nx)
- break;
- tty_putc(tty, ' ');
- ux++;
+ } else if (hidden != 0 || ux + gcp->data.width > nx) {
+ if (~gcp->flags & GRID_FLAG_PADDING) {
+ tty_attributes(tty, &last, defaults, palette);
+ tty_cursor(tty, atx + ux, aty);
+ for (j = 0; j < gcp->data.width; j++) {
+ if (ux + j > nx)
+ break;
+ tty_putc(tty, ' ');
+ ux++;
+ }
}
} else if (gcp->attr & GRID_ATTR_CHARSET) {
tty_attributes(tty, &last, defaults, palette);