Skip to content

Commit

Permalink
The individual -fg, -bg and -attr options have been deprecated (in
Browse files Browse the repository at this point in the history
favour of -style), undocumented and hidden from show-options since
2014. Remove them, except for status-fg and status-bg.
  • Loading branch information
nicm committed Mar 18, 2019
1 parent c624046 commit f34ebfe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 313 deletions.
23 changes: 12 additions & 11 deletions cmd-set-option.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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));
Expand All @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions cmd-show-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ cmd_show_options_all(struct cmd *self, struct cmdq_item *item,
o = options_first(oo);
while (o != NULL) {
oe = options_table_entry(o);
if (oe != NULL && oe->style != NULL) {
o = options_next(o);
continue;
}
if (!options_isarray(o))
cmd_show_options_print(self, item, o, -1);
else {
Expand Down
Loading

0 comments on commit f34ebfe

Please sign in to comment.