=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.345 retrieving revision 1.346 diff -c -r1.345 -r1.346 *** src/usr.bin/tmux/tty.c 2020/03/17 12:20:12 1.345 --- src/usr.bin/tmux/tty.c 2020/03/24 08:09:44 1.346 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.345 2020/03/17 12:20:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.346 2020/03/24 08:09:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1250,1255 **** --- 1250,1265 ---- return (&new); } + static int + tty_check_overlay(struct tty *tty, u_int px, u_int py) + { + struct client *c = tty->client; + + if (c->overlay_check == NULL) + return (1); + return (c->overlay_check(c, px, py)); + } + void tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s, u_int px, u_int py, u_int nx, u_int atx, u_int aty) *************** *** 1329,1335 **** grid_view_get_cell(gd, px + i, py, &gc); gcp = tty_check_codeset(tty, &gc); if (len != 0 && ! ((gcp->attr & GRID_ATTR_CHARSET) || gcp->flags != last.flags || gcp->attr != last.attr || gcp->fg != last.fg || --- 1339,1346 ---- grid_view_get_cell(gd, px + i, py, &gc); gcp = tty_check_codeset(tty, &gc); if (len != 0 && ! (!tty_check_overlay(tty, atx + ux + width, aty) || ! (gcp->attr & GRID_ATTR_CHARSET) || gcp->flags != last.flags || gcp->attr != last.attr || gcp->fg != last.fg || *************** *** 1358,1364 **** screen_select_cell(s, &last, gcp); else memcpy(&last, gcp, sizeof last); ! if (ux + gcp->data.width > nx) { tty_attributes(tty, &last, wp); tty_cursor(tty, atx + ux, aty); for (j = 0; j < gcp->data.width; j++) { --- 1369,1377 ---- 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) { tty_attributes(tty, &last, wp); tty_cursor(tty, atx + ux, aty); for (j = 0; j < gcp->data.width; j++) { *************** *** 1372,1378 **** tty_cursor(tty, atx + ux, aty); for (j = 0; j < gcp->data.size; j++) tty_putc(tty, gcp->data.data[j]); ! ux += gc.data.width; } else { memcpy(buf + len, gcp->data.data, gcp->data.size); len += gcp->data.size; --- 1385,1391 ---- tty_cursor(tty, atx + ux, aty); for (j = 0; j < gcp->data.size; j++) tty_putc(tty, gcp->data.data[j]); ! ux += gcp->data.width; } else { memcpy(buf + len, gcp->data.data, gcp->data.size); len += gcp->data.size;