mirror of
https://github.com/tmux/tmux.git
synced 2026-01-12 01:00:22 +00:00
Fix typo with visible_ranges struct name. Add support for checking visual ranges to tty_draw_pane.
This commit is contained in:
32
tty.c
32
tty.c
@@ -1373,23 +1373,41 @@ tty_draw_pane(struct tty *tty, const struct tty_ctx *ctx, u_int py)
|
|||||||
{
|
{
|
||||||
struct screen *s = ctx->s;
|
struct screen *s = ctx->s;
|
||||||
struct window_pane *wp = ctx->arg;
|
struct window_pane *wp = ctx->arg;
|
||||||
struct visible_range *vr = NULL;
|
struct visible_ranges *vr = NULL;
|
||||||
u_int nx = ctx->sx, i, x, rx, ry;
|
u_int nx = ctx->sx, i, x, rx, ry, r;
|
||||||
|
|
||||||
log_debug("%s: %s %u %d", __func__, tty->client->name, py, ctx->bigger);
|
log_debug("%s: %s %u %d", __func__, tty->client->name, py, ctx->bigger);
|
||||||
|
|
||||||
if (wp)
|
|
||||||
vr = screen_redraw_get_visible_ranges(wp, 0, py, nx);
|
|
||||||
|
|
||||||
if (!ctx->bigger) {
|
if (!ctx->bigger) {
|
||||||
|
if (wp) {
|
||||||
|
vr = screen_redraw_get_visible_ranges(wp, 0, py, nx);
|
||||||
|
for (r=0; r < vr->used; r++) {
|
||||||
|
if (vr->nx[r] == 0)
|
||||||
|
continue;
|
||||||
|
tty_draw_line(tty, s, vr->px[r], py, vr->nx[r],
|
||||||
|
ctx->xoff + vr->px[r], ctx->yoff + py,
|
||||||
|
&ctx->defaults, ctx->palette, vr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
tty_draw_line(tty, s, 0, py, nx, ctx->xoff, ctx->yoff + py,
|
tty_draw_line(tty, s, 0, py, nx, ctx->xoff, ctx->yoff + py,
|
||||||
&ctx->defaults, ctx->palette, vr);
|
&ctx->defaults, ctx->palette, vr);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tty_clamp_line(tty, ctx, 0, py, nx, &i, &x, &rx, &ry)) {
|
if (tty_clamp_line(tty, ctx, 0, py, nx, &i, &x, &rx, &ry)) {
|
||||||
|
if (wp) {
|
||||||
|
vr = screen_redraw_get_visible_ranges(wp, i, py, rx);
|
||||||
|
for (r=0; r < vr->used; r++) {
|
||||||
|
if (vr->nx[r] == 0)
|
||||||
|
continue;
|
||||||
|
tty_draw_line(tty, s, i, py, vr->nx[r], x + vr->px[r], ry, &ctx->defaults,
|
||||||
|
ctx->palette, vr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
tty_draw_line(tty, s, i, py, rx, x, ry, &ctx->defaults,
|
tty_draw_line(tty, s, i, py, rx, x, ry, &ctx->defaults,
|
||||||
ctx->palette, vr);
|
ctx->palette, vr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct grid_cell *
|
static const struct grid_cell *
|
||||||
@@ -1468,7 +1486,7 @@ tty_check_overlay_range(struct tty *tty, u_int px, u_int py, u_int nx,
|
|||||||
void
|
void
|
||||||
tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
|
tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
|
||||||
u_int atx, u_int aty, const struct grid_cell *defaults,
|
u_int atx, u_int aty, const struct grid_cell *defaults,
|
||||||
struct colour_palette *palette, struct visible_range *vr)
|
struct colour_palette *palette, struct visible_ranges *vr)
|
||||||
{
|
{
|
||||||
struct grid *gd = s->grid;
|
struct grid *gd = s->grid;
|
||||||
struct grid_cell gc, last;
|
struct grid_cell gc, last;
|
||||||
@@ -2216,7 +2234,7 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
struct screen *s = ctx->s;
|
struct screen *s = ctx->s;
|
||||||
struct overlay_ranges r;
|
struct overlay_ranges r;
|
||||||
struct window_pane *wp = ctx->arg;
|
struct window_pane *wp = ctx->arg;
|
||||||
struct visible_range *vr;
|
struct visible_ranges *vr;
|
||||||
u_int px, py, i, vis = 0;
|
u_int px, py, i, vis = 0;
|
||||||
|
|
||||||
px = ctx->xoff + ctx->ocx - ctx->wox;
|
px = ctx->xoff + ctx->ocx - ctx->wox;
|
||||||
|
|||||||
Reference in New Issue
Block a user