aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-04 05:33:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-04 05:33:15 +0000
commitd929862245ba4e7887a9eef63b21b3e34e2f29ce (patch)
tree6591375539a6ec7836b0d84682f9bbf74e5953b0 /config.c
parentfootrc: add new option 'scrollback.multiplier' (diff)
config: move cursor.hide-when-typing to mouse.hide-when-typing
Diffstat (limited to 'config.c')
-rw-r--r--config.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/config.c b/config.c
index 68424cca..59476f43 100644
--- a/config.c
+++ b/config.c
@@ -528,9 +528,6 @@ parse_section_cursor(const char *key, const char *value, struct config *conf,
else if (strcmp(key, "blink") == 0)
conf->cursor.blink = str_to_bool(value);
- else if (strcmp(key, "hide-when-typing") == 0)
- conf->cursor.hide_when_typing = str_to_bool(value);
-
else if (strcmp(key, "color") == 0) {
char *value_copy = strdup(value);
const char *text = strtok(value_copy, " ");
@@ -560,6 +557,21 @@ parse_section_cursor(const char *key, const char *value, struct config *conf,
}
static bool
+parse_section_mouse(const char *key, const char *value, struct config *conf,
+ const char *path, unsigned lineno)
+{
+ if (strcmp(key, "hide-when-typing") == 0)
+ conf->mouse.hide_when_typing = str_to_bool(value);
+
+ else {
+ LOG_AND_NOTIFY_ERR("%s:%d: [mouse]: %s: invalid key", path, lineno, key);
+ return false;
+ }
+
+ return true;
+}
+
+static bool
parse_section_csd(const char *key, const char *value, struct config *conf,
const char *path, unsigned lineno)
{
@@ -1029,6 +1041,7 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
SECTION_SCROLLBACK,
SECTION_COLORS,
SECTION_CURSOR,
+ SECTION_MOUSE,
SECTION_CSD,
SECTION_KEY_BINDINGS,
SECTION_SEARCH_BINDINGS,
@@ -1050,6 +1063,7 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
[SECTION_SCROLLBACK] = {&parse_section_scrollback, "scrollback"},
[SECTION_COLORS] = {&parse_section_colors, "colors"},
[SECTION_CURSOR] = {&parse_section_cursor, "cursor"},
+ [SECTION_MOUSE] = {&parse_section_mouse, "mouse"},
[SECTION_CSD] = {&parse_section_csd, "csd"},
[SECTION_KEY_BINDINGS] = {&parse_section_key_bindings, "key-bindings"},
[SECTION_SEARCH_BINDINGS] = {&parse_section_search_bindings, "search-bindings"},
@@ -1260,12 +1274,14 @@ config_load(struct config *conf, const char *conf_path, bool errors_are_fatal)
.cursor = {
.style = CURSOR_BLOCK,
.blink = false,
- .hide_when_typing = false,
.color = {
.text = 0,
.cursor = 0,
},
},
+ .mouse = {
+ .hide_when_typing = false,
+ },
.csd = {
.preferred = CONF_CSD_PREFER_SERVER,
.title_height = 26,