diff options
author | nicm <nicm> | 2019-03-14 09:53:52 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-03-14 09:53:52 +0000 |
commit | 13f9a061acd966757ae2f42c3a8ac24765ac65bd (patch) | |
tree | aaf112dfe439c6317ed449651db77285ac601566 /cmd-select-pane.c | |
parent | 1e9f8a3523ac93203036bd4a3740674a91fc4f1c (diff) | |
download | rtmux-13f9a061acd966757ae2f42c3a8ac24765ac65bd.tar.gz rtmux-13f9a061acd966757ae2f42c3a8ac24765ac65bd.tar.bz2 rtmux-13f9a061acd966757ae2f42c3a8ac24765ac65bd.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 'cmd-select-pane.c')
-rw-r--r-- | cmd-select-pane.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c index 87156250..2873737f 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -90,6 +90,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) struct window *w = wl->window; struct session *s = item->target.s; struct window_pane *wp = item->target.wp, *lastwp, *markedwp; + struct style *sy = &wp->style; char *pane_title; const char *style; @@ -142,19 +143,16 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) } if (args_has(self->args, 'P') || args_has(self->args, 'g')) { - if (args_has(args, 'P')) { - style = args_get(args, 'P'); - memcpy(&wp->colgc, &grid_default_cell, - sizeof wp->colgc); - if (style_parse(&grid_default_cell, &wp->colgc, - style) == -1) { + if ((style = args_get(args, 'P')) != NULL) { + style_set(sy, &grid_default_cell); + if (style_parse(sy, &grid_default_cell, style) == -1) { cmdq_error(item, "bad style: %s", style); return (CMD_RETURN_ERROR); } wp->flags |= PANE_REDRAW; } if (args_has(self->args, 'g')) - cmdq_print(item, "%s", style_tostring(&wp->colgc)); + cmdq_print(item, "%s", style_tostring(sy)); return (CMD_RETURN_NORMAL); } |