Do not check overlays in tty_draw_line_clear, the caller should be doing it.

This commit is contained in:
Nicholas Marriott
2026-05-24 12:25:51 +01:00
parent fb9e47d8c9
commit f75b1e5f07
3 changed files with 12 additions and 24 deletions

View File

@@ -1276,7 +1276,7 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
struct screen *s = wp->screen; struct screen *s = wp->screen;
struct colour_palette *palette = &wp->palette; struct colour_palette *palette = &wp->palette;
struct grid_cell defaults; struct grid_cell defaults;
u_int i, j, woy, wx, wy, py, width; u_int i, j, k, woy, wx, wy, py, width;
struct visible_ranges *r; struct visible_ranges *r;
struct visible_range *ri; struct visible_range *ri;
@@ -1333,8 +1333,8 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
r = tty_check_overlay_range(tty, wx, wy, width); r = tty_check_overlay_range(tty, wx, wy, width);
r = screen_redraw_get_visible_ranges(wp, wx, wy, width, r); r = screen_redraw_get_visible_ranges(wp, wx, wy, width, r);
tty_default_colours(&defaults, wp); tty_default_colours(&defaults, wp);
for (i = 0; i < r->used; i++) { for (k = 0; k < r->used; k++) {
ri = &r->ranges[i]; ri = &r->ranges[k];
if (ri->nx == 0) if (ri->nx == 0)
continue; continue;
tty_draw_line(tty, s, ri->px - wp->xoff, j, ri->nx, tty_draw_line(tty, s, ri->px - wp->xoff, j, ri->nx,

View File

@@ -46,10 +46,6 @@ static void
tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx, tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx,
const struct grid_cell *defaults, u_int bg, int wrapped) const struct grid_cell *defaults, u_int bg, int wrapped)
{ {
struct visible_ranges *r;
struct visible_range *rr;
u_int i;
/* Nothing to clear. */ /* Nothing to clear. */
if (nx == 0) if (nx == 0)
return; return;
@@ -82,20 +78,14 @@ tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx,
} }
/* Couldn't use an escape sequence, use spaces. */ /* Couldn't use an escape sequence, use spaces. */
r = tty_check_overlay_range(tty, px, py, nx); if (px != 0 || !wrapped)
for (i = 0; i < r->used; i++) { tty_cursor(tty, px, py);
rr = &r->ranges[i]; if (nx == 1)
if (rr->nx != 0) { tty_putc(tty, ' ');
if (rr->px != 0 || !wrapped) else if (nx == 2)
tty_cursor(tty, rr->px, py); tty_putn(tty, " ", 2, 2);
if (rr->nx == 1) else
tty_putc(tty, ' '); tty_repeat_space(tty, nx);
else if (rr->nx == 2)
tty_putn(tty, " ", 2, 2);
else
tty_repeat_space(tty, rr->nx);
}
}
} }
/* Draw a line from screen to tty. */ /* Draw a line from screen to tty. */

4
tty.c
View File

@@ -1306,9 +1306,7 @@ tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int py,
{ {
struct client *c = tty->client; struct client *c = tty->client;
const struct grid_cell *defaults = &ctx->defaults; const struct grid_cell *defaults = &ctx->defaults;
struct visible_ranges *r; u_int yy;
struct visible_range *ri;
u_int i, yy, oy = 0;
char tmp[64]; char tmp[64];
log_debug("%s: %s, %u,%u at %u,%u", __func__, c->name, nx, ny, px, py); log_debug("%s: %s, %u,%u at %u,%u", __func__, c->name, nx, ny, px, py);