From 36468b0406023cb8d66999eaabfdc5bbf94157d8 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 3 Aug 2020 19:43:06 +0200 Subject: config: add scrollback.multiplier option This option is used to multiply the mouse scroll amount for mouse and trackpad based scrollback scrolling. Closes #54. --- config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index 431d7817..68424cca 100644 --- a/config.c +++ b/config.c @@ -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, -- cgit v1.3