config: add 'scrollback-indicator-format' option

The value of this option must be either 'percent', or 'line', and
determines _how_ we render the scrollback indicator.
This commit is contained in:
Daniel Eklöf 2020-07-24 18:34:19 +02:00
parent e945063620
commit 5b868fd0c9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 20 additions and 0 deletions

View file

@ -294,6 +294,19 @@ parse_section_main(const char *key, const char *value, struct config *conf,
else if (strcmp(key, "scrollback-indicator") == 0)
conf->scrollback_indicator = str_to_bool(value);
else if (strcmp(key, "scrollback-indicator-format") == 0) {
if (strcmp(value, "percent") == 0)
conf->scrollback_indicator_format = SCROLLBACK_INDICATOR_PERCENT;
else if (strcmp(value, "line") == 0)
conf->scrollback_indicator_format = SCROLLBACK_INDICATOR_LINENO;
else {
LOG_ERR("%s:%d: 'scrollback-indicator-format must be one "
"of 'percent' or 'line', not %s",
path, lineno, value);
return false;
}
}
else {
LOG_ERR("%s:%u: invalid key: %s", path, lineno, key);
return false;
@ -922,6 +935,7 @@ config_load(struct config *conf, const char *conf_path)
.fonts = tll_init(),
.scrollback_lines = 1000,
.scrollback_indicator = true,
.scrollback_indicator_format = SCROLLBACK_INDICATOR_PERCENT,
.colors = {
.fg = default_foreground,