diff options
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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); |