aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-12 00:01:26 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-12 00:01:26 +0100
commit44ada9cd67e46676eaf0f9a19a681ddc1f898682 (patch)
treea56e87ba5007caaedbe33d5a8841bad715ba6582 /options.c
parente9d49161e0510b8b2eccbe33195789937d25796f (diff)
parent7eea3d7ab850bb8fbeeccbb4b0fe84b9274965af (diff)
downloadrtmux-44ada9cd67e46676eaf0f9a19a681ddc1f898682.tar.gz
rtmux-44ada9cd67e46676eaf0f9a19a681ddc1f898682.tar.bz2
rtmux-44ada9cd67e46676eaf0f9a19a681ddc1f898682.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'options.c')
-rw-r--r--options.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/options.c b/options.c
index 52f4f67e..23c83c07 100644
--- a/options.c
+++ b/options.c
@@ -402,7 +402,7 @@ options_array_clear(struct options_entry *o)
return;
RB_FOREACH_SAFE(a, options_array, &o->value.array, a1)
- options_array_free(o, a);
+ options_array_free(o, a);
}
union options_value *
@@ -425,6 +425,7 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
struct options_array_item *a;
char *new;
struct cmd_parse_result *pr;
+ long long number;
if (!OPTIONS_IS_ARRAY(o)) {
if (cause != NULL)
@@ -479,6 +480,20 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
return (0);
}
+ if (o->tableentry->type == OPTIONS_TABLE_COLOUR) {
+ if ((number = colour_fromstring(value)) == -1) {
+ xasprintf(cause, "bad colour: %s", value);
+ return (-1);
+ }
+ a = options_array_item(o, idx);
+ if (a == NULL)
+ a = options_array_new(o, idx);
+ else
+ options_value_free(o, &a->value);
+ a->value.number = number;
+ return (0);
+ }
+
if (cause != NULL)
*cause = xstrdup("wrong array type");
return (-1);
@@ -1113,6 +1128,10 @@ options_push_changes(const char *name)
RB_FOREACH(wp, window_pane_tree, &all_window_panes)
wp->flags |= PANE_STYLECHANGED;
}
+ if (strcmp(name, "pane-colours") == 0) {
+ RB_FOREACH(wp, window_pane_tree, &all_window_panes)
+ colour_palette_from_option(&wp->palette, wp->options);
+ }
if (strcmp(name, "pane-border-status") == 0) {
RB_FOREACH(w, windows, &windows)
layout_fix_panes(w, NULL);