diff options
author | 2020-05-16 14:53:23 +0000 | |
---|---|---|
committer | 2020-05-16 14:53:23 +0000 | |
commit | bf46d0ce190fe6df7f1df69233f5f243cc29b70c (patch) | |
tree | b5827891926a6ed22da8dab194565c3e2011db8c /usr.bin/tmux/tty.c | |
parent | Instead of forbidding invalid session names, sanitize them like window (diff) | |
download | wireguard-openbsd-bf46d0ce190fe6df7f1df69233f5f243cc29b70c.tar.xz wireguard-openbsd-bf46d0ce190fe6df7f1df69233f5f243cc29b70c.zip |
Use a grid cell not a style for the pane style.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 6ae908f4fb6..6c3735fd86b 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.369 2020/05/16 14:46:14 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.370 2020/05/16 14:53:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |