Explicitly setting key bindings can collide with default key bindings and throw an error.
This code makes an update such that now defining a keybinding will succeed but print a warning, as this could indicate a mistake. If you don't want the warning, you can explicitly unmap and re-map the binding.
It can be tested by adding the same keybinding to your config file twice. The later one should succeed with a warning.
This is a continuation of #429, with test coverage added.
Behavior Before
- Rebinding a key would not result an error
Behavior After
For example, with this in fuzzel.ini:
execute=y
execute=z
Could result in:
➤ fuzzel
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by Return
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by KP_Enter
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by Control+y
warn: config.c:314: unmapping keybinding defined at /home/mark/.config/fuzzel/fuzzel.ini:2: execute: was previously triggered by y
Explicitly setting key bindings can collide with default key bindings and throw an error.
This code makes an update such that now defining a keybinding will succeed but print a warning, as this could indicate a mistake. If you don't want the warning, you can explicitly unmap and re-map the binding.
It can be tested by adding the same keybinding to your config file twice. The later one should succeed with a warning.
This is a continuation of #429, with test coverage added.
## Behavior Before
- Rebinding a key would not result an error
## Behavior After
For example, with this in fuzzel.ini:
```
execute=y
execute=z
```
Could result in:
```
➤ fuzzel
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by Return
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by KP_Enter
warn: config.c:309: unmapping default keybinding: execute: was previously triggered by Control+y
warn: config.c:314: unmapping keybinding defined at /home/mark/.config/fuzzel/fuzzel.ini:2: execute: was previously triggered by y
```