diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-03-19 00:02:39 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-03-19 00:02:39 +0000 |
commit | 073d4399650b5716806d734d1869c7d52c6f2d61 (patch) | |
tree | a0861d425e1776bcc1557cfb8ab89ba9239142b7 /cmd-set-option.c | |
parent | f956c17c09160d7c8ab68502d2d5756ff3d0a557 (diff) | |
parent | 0406ec0ec29f6dd7b8ea663f50d766bce5904c78 (diff) | |
download | rtmux-073d4399650b5716806d734d1869c7d52c6f2d61.tar.gz rtmux-073d4399650b5716806d734d1869c7d52c6f2d61.tar.bz2 rtmux-073d4399650b5716806d734d1869c7d52c6f2d61.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index ddbfc334..96428d73 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -81,6 +81,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) char *name, *argument, *value = NULL, *cause; const char *target; int window, idx, already, error, ambiguous; + struct style *sy; /* Expand argument. */ c = cmd_find_client(item, NULL, 1); @@ -247,6 +248,16 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) tty_keys_build(&loop->tty); } } + if (strcmp(name, "status-fg") == 0 || strcmp(name, "status-bg") == 0) { + sy = options_get_style(oo, "status-style"); + sy->gc.fg = options_get_number(oo, "status-fg"); + sy->gc.bg = options_get_number(oo, "status-bg"); + } + if (strcmp(name, "status-style") == 0) { + sy = options_get_style(oo, "status-style"); + options_set_number(oo, "status-fg", sy->gc.fg); + options_set_number(oo, "status-bg", sy->gc.bg); + } if (strcmp(name, "status") == 0 || strcmp(name, "status-interval") == 0) status_timer_start_all(); @@ -342,16 +353,7 @@ cmd_set_option_set(struct cmd *self, struct cmdq_item *item, struct options *oo, cmdq_error(item, "bad colour: %s", value); return (-1); } - o = options_set_number(oo, oe->name, number); - options_style_update_new(oo, o); - return (0); - case OPTIONS_TABLE_ATTRIBUTES: - if ((number = attributes_fromstring(value)) == -1) { - cmdq_error(item, "bad attributes: %s", value); - return (-1); - } - o = options_set_number(oo, oe->name, number); - options_style_update_new(oo, o); + options_set_number(oo, oe->name, number); return (0); case OPTIONS_TABLE_FLAG: return (cmd_set_option_flag(item, oe, oo, value)); @@ -363,7 +365,6 @@ cmd_set_option_set(struct cmd *self, struct cmdq_item *item, struct options *oo, cmdq_error(item, "bad style: %s", value); return (-1); } - options_style_update_old(oo, o); return (0); case OPTIONS_TABLE_ARRAY: break; |