mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
config: do key binding collision detection after loading the conf
This allows the user to write, to swap two key bindings: [key-bindings] show-urls-launch=Control+Shift+r search-start=Control+Shift+u instead of: [key-bindings] search-start=none show-urls-launch=Control+Shift+r search-start=Control+Shift+u This should simplify the configuration for people who replace a lot of the default key bindings. This also simplifies the parsing somewhat, since we no longer has to parse a key-binding into a temporary list, ensure it doesn’t have any collisions, and then copy it into the actual key binding list. _While_ parsing a key-binding, we still need a temporary array (at least for the time being), but that temporary array is no longer visible outside the parsing function that allocates it.
This commit is contained in:
parent
fc2bacbb78
commit
197c1c5ced
2 changed files with 255 additions and 206 deletions
4
config.h
4
config.h
|
|
@ -45,6 +45,10 @@ struct config_key_binding {
|
|||
struct config_key_modifiers modifiers;
|
||||
xkb_keysym_t sym;
|
||||
struct config_binding_pipe pipe;
|
||||
|
||||
/* For error messages in collision handling */
|
||||
const char *path;
|
||||
int lineno;
|
||||
};
|
||||
DEFINE_LIST(struct config_key_binding);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue