=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.406 retrieving revision 1.407 diff -c -r1.406 -r1.407 *** src/usr.bin/tmux/tty.c 2021/10/11 13:27:50 1.406 --- src/usr.bin/tmux/tty.c 2021/10/14 09:54:51 1.407 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.406 2021/10/11 13:27:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.407 2021/10/14 09:54:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1993,2000 **** void tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx) { ! struct overlay_ranges r; ! u_int i, px; if (!tty_is_visible(tty, ctx, ctx->ocx, ctx->ocy, ctx->num, 1)) return; --- 1993,2001 ---- void tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx) { ! struct overlay_ranges r; ! u_int i, px, py, cx; ! char *cp = ctx->ptr; if (!tty_is_visible(tty, ctx, ctx->ocx, ctx->ocy, ctx->num, 1)) return; *************** *** 2017,2032 **** tty_margin_off(tty); tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy); - tty_attributes(tty, ctx->cell, &ctx->defaults, ctx->palette); ! px = tty->cx; ! tty_check_overlay_range(tty, px, tty->cy, ctx->num, &r); for (i = 0; i < OVERLAY_MAX_RANGES; i++) { if (r.nx[i] == 0) continue; ! tty_cursor(tty, r.px[i], tty->cy); ! tty_putn(tty, (char *)ctx->ptr + r.px[i] - px, r.nx[i], ! r.nx[i]); } } --- 2018,2037 ---- tty_margin_off(tty); tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy); tty_attributes(tty, ctx->cell, &ctx->defaults, ctx->palette); ! ! /* Get tty position from pane position for overlay check. */ ! px = ctx->xoff + ctx->ocx - ctx->wox; ! py = ctx->yoff + ctx->ocy - ctx->woy; ! ! tty_check_overlay_range(tty, px, py, ctx->num, &r); for (i = 0; i < OVERLAY_MAX_RANGES; i++) { if (r.nx[i] == 0) continue; ! /* Convert back to pane position for printing. */ ! cx = r.px[i] - ctx->xoff + ctx->wox; ! tty_cursor_pane_unless_wrap(tty, ctx, cx, ctx->ocy); ! tty_putn(tty, cp + r.px[i] - px, r.nx[i], r.nx[i]); } }