config: move cursor.hide-when-typing to mouse.hide-when-typing

This commit is contained in:
Daniel Eklöf 2020-08-04 07:33:15 +02:00
parent 8f04e898af
commit d929862245
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 38 additions and 10 deletions

View file

@ -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, " ");
@ -559,6 +556,21 @@ parse_section_cursor(const char *key, const char *value, struct config *conf,
return true;
}
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,