summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-select-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-14 09:53:53 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-14 09:53:53 +0000
commit04e3f7b6162f213f7635439d358717bff4f82bea (patch)
treee324042e4940d5731397b5e7e488e8847012854d /usr.bin/tmux/cmd-select-pane.c
parent3e1c6f45ac8c7b82c51357ffb6067cb8c8bca08f (diff)
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/cmd-select-pane.c')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index 4b7fdfe3cf4..9f4ff5bb721 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.46 2019/03/13 21:39:21 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.47 2019/03/14 09:53:52 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}