summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-03-14 09:53:52 +0000
committernicm <nicm@openbsd.org>2019-03-14 09:53:52 +0000
commita36fe1f8287a4105d1485f55e40cf34a37968161 (patch)
tree6a076ea080bd3e84496584a1af2e5e90b0f1f648 /usr.bin/tmux/window.c
parentDo not use const on struct window_pane, it causes more trouble than it (diff)
downloadwireguard-openbsd-a36fe1f8287a4105d1485f55e40cf34a37968161.tar.xz
wireguard-openbsd-a36fe1f8287a4105d1485f55e40cf34a37968161.zip
Add a wrapper (struct style) around styles rather than using the
grid_cell directly. There will be some non-cell members soon.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index ab62b905a8b..ccc9c5a6d2c 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.220 2019/03/14 09:50:09 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.221 2019/03/14 09:53:52 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -470,7 +470,7 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
void
window_redraw_active_switch(struct window *w, struct window_pane *wp)
{
- const struct grid_cell *gc;
+ struct style *sy;
if (wp == w->active)
return;
@@ -479,21 +479,21 @@ window_redraw_active_switch(struct window *w, struct window_pane *wp)
* If window-style and window-active-style are the same, we don't need
* to redraw panes when switching active panes.
*/
- gc = options_get_style(w->options, "window-active-style");
- if (style_equal(gc, options_get_style(w->options, "window-style")))
+ sy = options_get_style(w->options, "window-active-style");
+ if (style_equal(sy, options_get_style(w->options, "window-style")))
return;
/*
* If the now active or inactive pane do not have a custom style or if
* the palette is different, they need to be redrawn.
*/
- if (window_pane_get_palette(w->active, w->active->colgc.fg) != -1 ||
- window_pane_get_palette(w->active, w->active->colgc.bg) != -1 ||
- style_equal(&grid_default_cell, &w->active->colgc))
+ if (window_pane_get_palette(w->active, w->active->style.gc.fg) != -1 ||
+ window_pane_get_palette(w->active, w->active->style.gc.bg) != -1 ||
+ style_is_default(&w->active->style))
w->active->flags |= PANE_REDRAW;
- if (window_pane_get_palette(wp, wp->colgc.fg) != -1 ||
- window_pane_get_palette(wp, wp->colgc.bg) != -1 ||
- style_equal(&grid_default_cell, &wp->colgc))
+ if (window_pane_get_palette(wp, wp->style.gc.fg) != -1 ||
+ window_pane_get_palette(wp, wp->style.gc.bg) != -1 ||
+ style_is_default(&wp->style))
wp->flags |= PANE_REDRAW;
}
@@ -826,7 +826,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->saved_grid = NULL;
- memcpy(&wp->colgc, &grid_default_cell, sizeof wp->colgc);
+ style_set(&wp->style, &grid_default_cell);
screen_init(&wp->base, sx, sy, hlimit);
wp->screen = &wp->base;