Closed jose-elias-alvarez closed 10 hours ago
Given the following config:
require("blink.cmp").setup({ keymap = { select_prev = { "<S-Tab>" }, }, }) vim.keymap.set("i", "<S-Tab>", "<C-o>A")
Pressing <S-Tab> in insert mode when the Blink window is not visible creates an error:
<S-Tab>
E5108: Error executing lua: Vim:E15: Invalid expression: "^OA"
The issue is that nvim_eval is unconditionally called on mapping.rhs, so this PR fixes the logic to only evaluate the result of <expr> mappings.
nvim_eval
mapping.rhs
<expr>
I also fixed a bug in the if mapping conditions, which are a little different in nvim-cmp because these fields are converted into boolean values.
if mapping
As you noted in a comment, handling fallback keymaps correctly in all cases is tricky, but for the moment, this should at least unblock a common case.
Thanks!
Given the following config:
Pressing
<S-Tab>
in insert mode when the Blink window is not visible creates an error:The issue is that
nvim_eval
is unconditionally called onmapping.rhs
, so this PR fixes the logic to only evaluate the result of<expr>
mappings.I also fixed a bug in the
if mapping
conditions, which are a little different in nvim-cmp because these fields are converted into boolean values.As you noted in a comment, handling fallback keymaps correctly in all cases is tricky, but for the moment, this should at least unblock a common case.