Skip to content

BUG: Plugin keybindings can override built-in shortcuts #517

@andrinoff

Description

@andrinoff

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

  1. Create a plugin that binds a built-in key:
matcha.bind_key("d", "inbox", "My plugin", function() end)
  1. Install and load the plugin
  2. Press d in 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions