summaryrefslogtreecommitdiffstats
path: root/options-table.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-03-18 21:24:49 +0000
committerThomas Adam <thomas@xteddy.org>2019-03-18 21:24:49 +0000
commit962f255ee8f271920e8901824ae30fa7a0b40804 (patch)
tree32c8466be03d668fc42360e5f415ad689c5c95f9 /options-table.c
parent1d6fe43c7b2250f042d0113da8545d5ebb75c01e (diff)
parent979313832ce1d5f6cdc2c512e8524d6c517422e0 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'options-table.c')
-rw-r--r--options-table.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/options-table.c b/options-table.c
index 2f760b74..76e75722 100644
--- a/options-table.c
+++ b/options-table.c
@@ -38,6 +38,9 @@ static const char *options_table_mode_keys_list[] = {
static const char *options_table_clock_mode_style_list[] = {
"12", "24", NULL
};
+static const char *options_table_status_list[] = {
+ "off", "on", "2", "3", "4", "5", NULL
+};
static const char *options_table_status_keys_list[] = {
"emacs", "vi", NULL
};
@@ -63,6 +66,46 @@ static const char *options_table_window_size_list[] = {
"largest", "smallest", "manual", NULL
};
+/* Status line format. */
+#define OPTIONS_TABLE_STATUS_FORMAT1 \
+ "#[align=left range=left #{status-left-style}]" \
+ "#{T;=/#{status-left-length}:status-left}#[norange default]" \
+ "#[list=on align=#{status-justify}]" \
+ "#[list=left-marker]<#[list=right-marker]>#[list=on]" \
+ "#{W:" \
+ "#[range=window|#{window_index}" \
+ "#{?window_last_flag, #{window-status-last-style},}" \
+ "#{?window_bell_flag," \
+ " #{window-status-bell-style}," \
+ "#{?window_activity_flag," \
+ " #{window-status-activity-style},}" \
+ "}" \
+ "]" \
+ "#{T:window-status-format}" \
+ "#[norange default]" \
+ "#{?window_end_flag,,#{window-status-separator}}" \
+ "," \
+ "#[range=window|#{window_index} list=focus" \
+ "#{?window_last_flag, #{window-status-last-style},}" \
+ "#{?window_bell_flag," \
+ " #{window-status-bell-style}," \
+ "#{?window_activity_flag," \
+ " #{window-status-activity-style},}" \
+ "}" \
+ "]" \
+ "#{T:window-status-current-format}" \
+ "#[norange list=on default]" \
+ "#{?window_end_flag,,#{window-status-separator}}" \
+ "}" \
+ "#[nolist align=right range=right #{status-right-style}]" \
+ "#{T;=/#{status-right-length}:status-right}#[norange default]"
+#define OPTIONS_TABLE_STATUS_FORMAT2 \
+ "#[align=centre]#{P:#{?pane_active,#[reverse],}" \
+ "#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
+static const char *options_table_status_format_default[] = {
+ OPTIONS_TABLE_STATUS_FORMAT1, OPTIONS_TABLE_STATUS_FORMAT2, NULL
+};
+
/* Top-level options. */
const struct options_table_entry options_table[] = {
{ .name = "buffer-limit",
@@ -377,8 +420,9 @@ const struct options_table_entry options_table[] = {
},
{ .name = "status",
- .type = OPTIONS_TABLE_FLAG,
+ .type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_SESSION,
+ .choices = options_table_status_list,
.default_num = 1
},
@@ -403,6 +447,12 @@ const struct options_table_entry options_table[] = {
.style = "status-style"
},
+ { .name = "status-format",
+ .type = OPTIONS_TABLE_ARRAY,
+ .scope = OPTIONS_TABLE_SESSION,
+ .default_arr = options_table_status_format_default,
+ },
+
{ .name = "status-interval",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_SESSION,