Skip to content

Input window insert-mode keybinds intermittently don't fire #332

@jemag

Description

@jemag

Context

I've been running into an issue where my keybinds like <M-m> (switch_mode) and <C-s> (submit_input_prompt) sometimes don't work when pressed in insert mode in the input window. Going back to normal mode and pressing the same key always works fine. The behavior is inconsistent — sometimes the key works in insert mode, sometimes it doesn't.

After digging into it, I think the issue is related to how wrap_with_completion_check works in keymap.lua. Right now, when input window keymaps are registered, setup_window_keymaps is called with defer_to_completion=true, which wraps every input window keymap with the completion visibility check. There is also a similar behavior in the input_window.lua in handle_submit() function.

This wrapping makes sense for keys that could genuinely conflict with completion navigation (like <CR>, <Tab>), but this is not my case and makes it a more painful experience. Basically, there isn't any situation where I would not want <M-m> or <C-s> to do the actions configured.

Feature request:

It would be nice to have a way to control this on a per-keybinding basis and perhaps also globally (i.e. bypass any completion or similar check and ensure keybind does the configured behavior)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions