mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-09 08:21:01 -04:00
config: do key binding collision handling in overrides
This ensures we detect, and handle, collisions also for key-bindings specified as overrides.
This commit is contained in:
parent
0018e570d4
commit
cff097197f
2 changed files with 19 additions and 18 deletions
|
|
@ -72,6 +72,8 @@
|
||||||
* Exit code being 0 when a foot server with no open windows terminate
|
* Exit code being 0 when a foot server with no open windows terminate
|
||||||
due to e.g. a Wayland connection failure
|
due to e.g. a Wayland connection failure
|
||||||
(https://codeberg.org/dnkl/foot/issues/943).
|
(https://codeberg.org/dnkl/foot/issues/943).
|
||||||
|
* Key binding collisions not detected for bindings specified as option
|
||||||
|
overrides on the command line.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
35
config.c
35
config.c
|
|
@ -3053,25 +3053,12 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = parse_config_file(f, conf, conf_file.path, errors_are_fatal) &&
|
if (!parse_config_file(f, conf, conf_file.path, errors_are_fatal) ||
|
||||||
config_override_apply(conf, overrides, errors_are_fatal);
|
!config_override_apply(conf, overrides, errors_are_fatal))
|
||||||
|
|
||||||
if (ret &&
|
|
||||||
(!resolve_key_binding_collisions(
|
|
||||||
conf, section_info[SECTION_KEY_BINDINGS].name,
|
|
||||||
binding_action_map, &conf->bindings.key, KEY_BINDING) ||
|
|
||||||
!resolve_key_binding_collisions(
|
|
||||||
conf, section_info[SECTION_SEARCH_BINDINGS].name,
|
|
||||||
search_binding_action_map, &conf->bindings.search, KEY_BINDING) ||
|
|
||||||
!resolve_key_binding_collisions(
|
|
||||||
conf, section_info[SECTION_URL_BINDINGS].name,
|
|
||||||
url_binding_action_map, &conf->bindings.url, KEY_BINDING) ||
|
|
||||||
!resolve_key_binding_collisions(
|
|
||||||
conf, section_info[SECTION_MOUSE_BINDINGS].name,
|
|
||||||
binding_action_map, &conf->bindings.mouse, MOUSE_BINDING)))
|
|
||||||
{
|
{
|
||||||
ret = !errors_are_fatal;
|
ret = !errors_are_fatal;
|
||||||
}
|
} else
|
||||||
|
ret = true;
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
|
@ -3163,7 +3150,19 @@ config_override_apply(struct config *conf, config_override_t *overrides,
|
||||||
conf->csd.border_width = max(
|
conf->csd.border_width = max(
|
||||||
min_csd_border_width, conf->csd.border_width_visible);
|
min_csd_border_width, conf->csd.border_width_visible);
|
||||||
|
|
||||||
return true;
|
return
|
||||||
|
resolve_key_binding_collisions(
|
||||||
|
conf, section_info[SECTION_KEY_BINDINGS].name,
|
||||||
|
binding_action_map, &conf->bindings.key, KEY_BINDING) &&
|
||||||
|
resolve_key_binding_collisions(
|
||||||
|
conf, section_info[SECTION_SEARCH_BINDINGS].name,
|
||||||
|
search_binding_action_map, &conf->bindings.search, KEY_BINDING) &&
|
||||||
|
resolve_key_binding_collisions(
|
||||||
|
conf, section_info[SECTION_URL_BINDINGS].name,
|
||||||
|
url_binding_action_map, &conf->bindings.url, KEY_BINDING) &&
|
||||||
|
resolve_key_binding_collisions(
|
||||||
|
conf, section_info[SECTION_MOUSE_BINDINGS].name,
|
||||||
|
binding_action_map, &conf->bindings.mouse, MOUSE_BINDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void NOINLINE
|
static void NOINLINE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue