summaryrefslogtreecommitdiffstats
path: root/screen-redraw.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-11 20:49:55 +0000
committernicm <nicm>2021-08-11 20:49:55 +0000
commit7eea3d7ab850bb8fbeeccbb4b0fe84b9274965af (patch)
tree7967e985cb56c93a0fd80dfebe01079c4dbdd43e /screen-redraw.c
parent01fd4b997e3a0a74ea57d6830cf97f98ea2c2a7c (diff)
Break the colour palette into a struct rather than just a single array
and use that to support the OSC palette-setting sequences in popups. Also add a pane-colours array option to specify the defaults. GitHub issue 2815.
Diffstat (limited to 'screen-redraw.c')
-rw-r--r--screen-redraw.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/screen-redraw.c b/screen-redraw.c
index 4c4135a8..3df57383 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -800,12 +800,13 @@ 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;
- struct grid_cell defaults;
- u_int i, j, top, x, y, width;
+ 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;
+ u_int i, j, top, x, y, width;
log_debug("%s: %s @%u %%%u", __func__, c->name, w->id, wp->id);
@@ -815,8 +816,6 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
top = ctx->statuslines;
else
top = 0;
-
- s = wp->screen;
for (j = 0; j < wp->sy; j++) {
if (wp->yoff + j < ctx->oy || wp->yoff + j >= ctx->oy + ctx->sy)
continue;
@@ -849,7 +848,6 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
__func__, c->name, wp->id, i, j, x, y, width);
tty_default_colours(&defaults, wp);
- tty_draw_line(tty, s, i, j, width, x, y, &defaults,
- wp->palette);
+ tty_draw_line(tty, s, i, j, width, x, y, &defaults, palette);
}
}