diff options
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -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); |