Redraw correctly when a popup is present above pane borders, GitHub

issue 4997 from Manuel Einfalt.
This commit is contained in:
nicm
2026-04-23 11:29:23 +00:00
parent bc15723f7f
commit ffe80579df

View File

@@ -949,8 +949,8 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
struct colour_palette *palette = &wp->palette; struct colour_palette *palette = &wp->palette;
struct grid_cell defaults; struct grid_cell defaults;
struct visible_ranges *r; struct visible_ranges *r;
struct visible_range *rr; struct visible_range *rr = NULL;
u_int i, j, k, top, x, y, width; u_int i, j, k, top, x, y, width, used;
if (wp->base.mode & MODE_SYNC) if (wp->base.mode & MODE_SYNC)
screen_write_stop_sync(wp); screen_write_stop_sync(wp);
@@ -997,14 +997,19 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
tty_default_colours(&defaults, wp); tty_default_colours(&defaults, wp);
r = tty_check_overlay_range(tty, x, y, width); r = tty_check_overlay_range(tty, x, y, width);
for (k = 0; k < r->used; k++) { used = r->used;
rr = &r->ranges[k];
if (rr->nx != 0) { rr = xreallocarray(rr, used, sizeof *rr);
tty_draw_line(tty, s, rr->px - wp->xoff, j, memcpy(rr, r->ranges, used * sizeof *rr);
rr->nx, rr->px, y, &defaults, palette);
for (k = 0; k < used; k++) {
if (rr[k].nx != 0) {
tty_draw_line(tty, s, rr[k].px - wp->xoff, j,
rr[k].nx, rr[k].px, y, &defaults, palette);
} }
} }
} }
free(rr);
} }
/* Draw the panes scrollbars */ /* Draw the panes scrollbars */