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)
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_checkworks inkeymap.lua. Right now, when input window keymaps are registered,setup_window_keymapsis called withdefer_to_completion=true, which wraps every input window keymap with the completion visibility check. There is also a similar behavior in theinput_window.luainhandle_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)