Use a grid cell not a style for the pane style.

This commit is contained in:
Nicholas Marriott
2020-04-27 15:15:12 +01:00
parent c30e765c7b
commit 79b4d83952
5 changed files with 39 additions and 63 deletions

24
tty.c
View File

@ -2690,27 +2690,19 @@ static void
tty_default_colours(struct grid_cell *gc, struct window_pane *wp)
{
struct options *oo = wp->options;
struct style *style, *active_style;
int c;
if (wp->flags & PANE_STYLECHANGED) {
wp->flags &= ~PANE_STYLECHANGED;
active_style = options_get_style(oo, "window-active-style");
style = options_get_style(oo, "window-style");
style_copy(&wp->cached_active_style, active_style);
style_copy(&wp->cached_style, style);
} else {
active_style = &wp->cached_active_style;
style = &wp->cached_style;
style_apply(&wp->cached_active_gc, oo, "window-active-style");
style_apply(&wp->cached_gc, oo, "window-style");
}
if (gc->fg == 8) {
if (wp == wp->window->active && active_style->gc.fg != 8)
gc->fg = active_style->gc.fg;
if (wp == wp->window->active && wp->cached_active_gc.fg != 8)
gc->fg = wp->cached_active_gc.fg;
else
gc->fg = style->gc.fg;
gc->fg = wp->cached_gc.fg;
if (gc->fg != 8) {
c = window_pane_get_palette(wp, gc->fg);
@ -2720,10 +2712,10 @@ tty_default_colours(struct grid_cell *gc, struct window_pane *wp)
}
if (gc->bg == 8) {
if (wp == wp->window->active && active_style->gc.bg != 8)
gc->bg = active_style->gc.bg;
if (wp == wp->window->active && wp->cached_active_gc.bg != 8)
gc->bg = wp->cached_active_gc.bg;
else
gc->bg = style->gc.bg;
gc->bg = wp->cached_gc.bg;
if (gc->bg != 8) {
c = window_pane_get_palette(wp, gc->bg);