mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Add a set-default style attribute which replaces the current default
colours and attributes completely, useful at the start of compound format strings (like status-format) to set the default colours for all the following options.
This commit is contained in:
4
style.c
4
style.c
@ -98,6 +98,8 @@ style_parse(struct style *sy, const struct grid_cell *base, const char *in)
|
||||
sy->default_type = STYLE_DEFAULT_PUSH;
|
||||
else if (strcasecmp(tmp, "pop-default") == 0)
|
||||
sy->default_type = STYLE_DEFAULT_POP;
|
||||
else if (strcasecmp(tmp, "set-default") == 0)
|
||||
sy->default_type = STYLE_DEFAULT_SET;
|
||||
else if (strcasecmp(tmp, "nolist") == 0)
|
||||
sy->list = STYLE_LIST_OFF;
|
||||
else if (strncasecmp(tmp, "list=", 5) == 0) {
|
||||
@ -310,6 +312,8 @@ style_tostring(struct style *sy)
|
||||
tmp = "push-default";
|
||||
else if (sy->default_type == STYLE_DEFAULT_POP)
|
||||
tmp = "pop-default";
|
||||
else if (sy->default_type == STYLE_DEFAULT_SET)
|
||||
tmp = "set-default";
|
||||
off += xsnprintf(s + off, sizeof s - off, "%s%s", comma, tmp);
|
||||
comma = ",";
|
||||
}
|
||||
|
Reference in New Issue
Block a user