Change overlay_ranges into visible_ranges.

This commit is contained in:
Michael Grant
2026-01-21 19:34:19 +00:00
parent 35485f2b5e
commit a25c14d472
7 changed files with 130 additions and 130 deletions

View File

@@ -808,22 +808,23 @@ screen_redraw_draw_border_arrows(struct screen_redraw_ctx *ctx, u_int i,
static void
screen_redraw_draw_borders_cell(struct screen_redraw_ctx *ctx, u_int i, u_int j)
{
struct client *c = ctx->c;
struct session *s = c->session;
struct window *w = s->curw->window;
struct options *oo = w->options;
struct tty *tty = &c->tty;
struct format_tree *ft;
struct window_pane *wp, *active = server_client_get_pane(c);
struct grid_cell gc;
const struct grid_cell *tmp;
struct visible_ranges *r;
u_int cell_type, x = ctx->ox + i, y = ctx->oy + j;
int isolates;
struct client *c = ctx->c;
struct session *s = c->session;
struct window *w = s->curw->window;
struct options *oo = w->options;
struct tty *tty = &c->tty;
struct format_tree *ft;
struct window_pane *wp, *active = server_client_get_pane(c);
struct grid_cell gc;
const struct grid_cell *tmp;
static struct visible_ranges r = { NULL, 0, 0 };
u_int cell_type;
u_int x = ctx->ox + i, y = ctx->oy + j;
int isolates;
if (c->overlay_check != NULL) {
r = c->overlay_check(c, c->overlay_data, x, y, 1);
if (r->nx[0] + r->nx[1] == 0)
c->overlay_check(c, c->overlay_data, x, y, 1, &r);
if (r.ranges[0].nx + r.ranges[1].nx == 0)
return;
}
@@ -937,14 +938,14 @@ screen_redraw_draw_status(struct screen_redraw_ctx *ctx)
static void
screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
{
struct client *c = ctx->c;
struct window *w = c->session->curw->window;
struct tty *tty = &c->tty;
struct screen *s = wp->screen;
struct colour_palette *palette = &wp->palette;
struct grid_cell defaults;
struct visible_ranges *vr;
u_int i, j, top, x, y, px, width, r;
struct client *c = ctx->c;
struct window *w = c->session->curw->window;
struct tty *tty = &c->tty;
struct screen *s = wp->screen;
struct colour_palette *palette = &wp->palette;
struct grid_cell defaults;
static struct visible_ranges vr;
u_int i, j, top, x, y, px, width, r;
if (wp->base.mode & MODE_SYNC)
screen_write_stop_sync(wp);
@@ -989,21 +990,21 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
__func__, c->name, wp->id, i, j, x, y, width);
/* xxxx Breaking up the tty_draw_line like this isn't fully working. */
vr = tty_check_overlay_range(tty, x, y, width);
tty_check_overlay_range(tty, x, y, width, &vr);
tty_default_colours(&defaults, wp);
for (r=0; r < vr->used; r++) {
if (vr->nx[r] == 0)
for (r=0; r < vr.used; r++) {
if (vr.ranges[r].nx == 0)
continue;
/* Convert window coordinates to tty coordinates. */
px = vr->px[r];
px = vr.ranges[r].px;
/* i is px of cell, add px of region, sub the
* pane offset. If you don't sub offset,
* contents of pane shifted. note: i apparently unnec.
*/
tty_draw_line(tty, s, /* i + */ vr->px[r] - wp->xoff, j,
vr->nx[r], px, y, &defaults, palette);
tty_draw_line(tty, s, /* i + */ vr.ranges[r].px - wp->xoff, j,
vr.ranges[r].nx, px, y, &defaults, palette);
}
}