Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-03-23 12:01:10 +00:00
6 changed files with 67 additions and 26 deletions

39
tty.c
View File

@@ -1162,6 +1162,9 @@ tty_clear_line(struct tty *tty, const struct grid_cell *defaults, u_int py,
u_int px, u_int nx, u_int bg)
{
struct client *c = tty->client;
struct visible_ranges *r;
struct visible_range *rr;
u_int i;
log_debug("%s: %s, %u at %u,%u", __func__, c->name, nx, px, py);
@@ -1197,8 +1200,14 @@ tty_clear_line(struct tty *tty, const struct grid_cell *defaults, u_int py,
* Couldn't use an escape sequence, use spaces. Clear only the visible
* bit if there is an overlay.
*/
tty_cursor(tty, px, py);
tty_repeat_space(tty, nx);
r = tty_check_overlay_range(tty, px, py, nx);
for (i = 0; i < r->used; i++) {
rr = &r->ranges[i];
if (rr->nx != 0) {
tty_cursor(tty, rr->px, py);
tty_repeat_space(tty, rr->nx);
}
}
}
/* Clear a line, adjusting to visible part of pane. */
@@ -1364,18 +1373,34 @@ static void
tty_draw_pane(struct tty *tty, const struct tty_ctx *ctx, u_int py)
{
struct screen *s = ctx->s;
u_int nx = ctx->sx, i, x, rx, ry;
u_int nx = ctx->sx, i, x, rx, ry, j;
struct visible_ranges *r;
struct visible_range *rr;
log_debug("%s: %s %u %d", __func__, tty->client->name, py, ctx->bigger);
if (!ctx->bigger) {
tty_draw_line(tty, s, 0, py, nx, ctx->xoff, ctx->yoff + py,
&ctx->defaults, ctx->palette);
r = tty_check_overlay_range(tty, ctx->xoff, ctx->yoff + py, nx);
for (j = 0; j < r->used; j++) {
rr = &r->ranges[j];
if (rr->nx != 0) {
tty_draw_line(tty, s, rr->px - ctx->xoff, py,
rr->nx, rr->px, ctx->yoff + py,
&ctx->defaults, ctx->palette);
}
}
return;
}
if (tty_clamp_line(tty, ctx, 0, py, nx, &i, &x, &rx, &ry)) {
tty_draw_line(tty, s, i, py, rx, x, ry, &ctx->defaults,
ctx->palette);
r = tty_check_overlay_range(tty, x, ry, rx);
for (j = 0; j < r->used; j++) {
rr = &r->ranges[j];
if (rr->nx != 0) {
tty_draw_line(tty, s, i + (rr->px - x), py,
rr->nx, rr->px, ry, &ctx->defaults,
ctx->palette);
}
}
}
}