aboutsummaryrefslogtreecommitdiff
path: root/options-table.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2020-04-28 13:50:07 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2020-04-28 13:50:07 +0100
commit1f8256fc508bbee24b53fcd588ebf74653d69dfa (patch)
treed664861f00c35ccb98431281618fa84a7d1da0fd /options-table.c
parenta43a15684667d0ef223b8ad88538cca04186dd8b (diff)
downloadrtmux-1f8256fc508bbee24b53fcd588ebf74653d69dfa.tar.gz
rtmux-1f8256fc508bbee24b53fcd588ebf74653d69dfa.tar.bz2
rtmux-1f8256fc508bbee24b53fcd588ebf74653d69dfa.zip
Drop having a separate type for style options and make them all strings, which
allows formats to be expanded. Any styles without a '#{' are still validated when they are set but any with a '#{' are not. Formats are not expanded usefully in many cases yet, that will be changed later. To make this work, a few other changes: - set-option -a with a style option automatically appends a ",". - OSC 10 and 11 don't set the window-style option anymore, instead the fg and bg are stored in the pane struct and act as the defaults that can be overridden by window-style. - status-fg and -bg now override status-style instead of trying to keep them in sync.
Diffstat (limited to 'options-table.c')
-rw-r--r--options-table.c94
1 files changed, 62 insertions, 32 deletions
diff --git a/options-table.c b/options-table.c
index d593eff6..7c60e404 100644
--- a/options-table.c
+++ b/options-table.c
@@ -400,15 +400,19 @@ const struct options_table_entry options_table[] = {
},
{ .name = "message-command-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
- .default_str = "bg=black,fg=yellow"
+ .default_str = "bg=black,fg=yellow",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "message-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
- .default_str = "bg=yellow,fg=black"
+ .default_str = "bg=yellow,fg=black",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "mouse",
@@ -472,13 +476,13 @@ const struct options_table_entry options_table[] = {
{ .name = "status-bg",
.type = OPTIONS_TABLE_COLOUR,
.scope = OPTIONS_TABLE_SESSION,
- .default_num = 2,
+ .default_num = 8,
},
{ .name = "status-fg",
.type = OPTIONS_TABLE_COLOUR,
.scope = OPTIONS_TABLE_SESSION,
- .default_num = 0,
+ .default_num = 8,
},
{ .name = "status-format",
@@ -525,9 +529,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "status-left-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "status-position",
@@ -554,15 +560,19 @@ const struct options_table_entry options_table[] = {
},
{ .name = "status-right-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "status-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION,
- .default_str = "bg=green,fg=black"
+ .default_str = "bg=green,fg=black",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "update-environment",
@@ -665,9 +675,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "mode-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "bg=yellow,fg=black"
+ .default_str = "bg=yellow,fg=black",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "monitor-activity",
@@ -703,9 +715,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "pane-active-border-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "fg=green"
+ .default_str = "fg=green",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "pane-base-index",
@@ -731,9 +745,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "pane-border-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "remain-on-exit",
@@ -749,9 +765,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "window-active-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-size",
@@ -762,21 +780,27 @@ const struct options_table_entry options_table[] = {
},
{ .name = "window-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-status-activity-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "reverse"
+ .default_str = "reverse",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-status-bell-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "reverse"
+ .default_str = "reverse",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-status-current-format",
@@ -786,9 +810,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "window-status-current-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-status-format",
@@ -798,9 +824,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "window-status-last-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "window-status-separator",
@@ -810,9 +838,11 @@ const struct options_table_entry options_table[] = {
},
{ .name = "window-status-style",
- .type = OPTIONS_TABLE_STYLE,
+ .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
- .default_str = "default"
+ .default_str = "default",
+ .flags = OPTIONS_TABLE_IS_STYLE,
+ .separator = ","
},
{ .name = "wrap-search",