config: add scrollback.multiplier option

This option is used to multiply the mouse scroll amount for mouse and
trackpad based scrollback scrolling.

Closes #54.
This commit is contained in:
Daniel Eklöf 2020-08-03 19:43:06 +02:00
parent 93b03c91ed
commit 36468b0406
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 22 additions and 2 deletions

View file

@ -439,6 +439,17 @@ parse_section_scrollback(const char *key, const char *value, struct config *conf
}
}
else if (strcmp(key, "multiplier") == 0) {
double multiplier;
if (!str_to_double(value, &multiplier)) {
LOG_AND_NOTIFY_ERR("%s:%d: [scrollback]: multiplier: "
"invalid value: %s", path, lineno, value);
return false;
}
conf->scrollback.multiplier = multiplier;
}
else {
LOG_AND_NOTIFY_ERR("%s:%u: [scrollback]: %s: invalid key", path, lineno, key);
return false;
@ -1218,6 +1229,7 @@ config_load(struct config *conf, const char *conf_path, bool errors_are_fatal)
.format = SCROLLBACK_INDICATOR_FORMAT_TEXT,
.text = wcsdup(L""),
},
.multiplier = 1.,
},
.colors = {
.fg = default_foreground,