aboutsummaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-05 14:19:22 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-11 19:19:11 +0000
commit197c1c5ced20f5783f2359a10d7096f0e1a438d2 (patch)
tree14fb6cdc16145601bf883b740a02292183463493 /config.h
parentconfig: remove struct key_combo, use config_key_binding instead (diff)
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.
Diffstat (limited to 'config.h')
-rw-r--r--config.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.h b/config.h
index 2ae3a2d5..ee968748 100644
--- a/config.h
+++ b/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);