diff --git a/options.c b/options.c index 08d9275f..9ea5c118 100644 --- a/options.c +++ b/options.c @@ -169,12 +169,17 @@ options_empty(struct options *oo, const struct options_table_entry *oe) struct options_entry * options_default(struct options *oo, const struct options_table_entry *oe) { - struct options_entry *o; + struct options_entry *o; + u_int i; o = options_empty(oo, oe); - if (oe->type == OPTIONS_TABLE_ARRAY) - options_array_assign(o, oe->default_str); - else if (oe->type == OPTIONS_TABLE_STRING) + if (oe->type == OPTIONS_TABLE_ARRAY) { + if (oe->default_arr != NULL) { + for (i = 0; oe->default_arr[i] != NULL; i++) + options_array_set(o, i, oe->default_arr[i], 0); + } else + options_array_assign(o, oe->default_str); + } else if (oe->type == OPTIONS_TABLE_STRING) o->string = xstrdup(oe->default_str); else if (oe->type == OPTIONS_TABLE_STYLE) { style_set(&o->style, &grid_default_cell); diff --git a/tmux.h b/tmux.h index 26f11e23..4b16eb83 100644 --- a/tmux.h +++ b/tmux.h @@ -1497,6 +1497,7 @@ struct options_table_entry { const char *default_str; long long default_num; + const char **default_arr; const char *separator; const char *style;