matcha
matcha copied to clipboard
BUG: Plugin keybindings can override built-in shortcuts
Describe the bug
In plugin/api.go, matcha.bind_key() appends keybindings without checking for conflicts with built-in shortcuts (d for delete, a for archive, r for reply, v for visual mode, etc.). A plugin registering a conflicting key silently breaks core functionality.
m.bindings = append(m.bindings, KeyBinding{
Key: key,
Area: area,
Description: description,
Fn: fn,
})
To reproduce
- Create a plugin that binds a built-in key:
matcha.bind_key("d", "inbox", "My plugin", function() end)
- Install and load the plugin
- Press
din the inbox — either the plugin or delete runs, but not both as expected
Expected behavior
Either:
- Warn the user when a plugin tries to bind a key that conflicts with a built-in shortcut
- Give built-in shortcuts priority and log a warning
- Allow users to resolve conflicts via configuration
OS
All platforms
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.