mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-18 22:05:25 -05: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
|
||||
due to e.g. a Wayland connection failure
|
||||
(https://codeberg.org/dnkl/foot/issues/943).
|
||||
* Key binding collisions not detected for bindings specified as option
|
||||
overrides on the command line.
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
35
config.c
35
config.c
|
|
@ -3053,25 +3053,12 @@ config_load(struct config *conf, const char *conf_path,
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = parse_config_file(f, conf, conf_file.path, 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)))
|
||||
if (!parse_config_file(f, conf, conf_file.path, errors_are_fatal) ||
|
||||
!config_override_apply(conf, overrides, errors_are_fatal))
|
||||
{
|
||||
ret = !errors_are_fatal;
|
||||
}
|
||||
} else
|
||||
ret = true;
|
||||
|
||||
fclose(f);
|
||||
|
||||
|
|
@ -3163,7 +3150,19 @@ config_override_apply(struct config *conf, config_override_t *overrides,
|
|||
conf->csd.border_width = max(
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue