Skip to content

Commit df5c0de

Browse files
committed
fix: replace keycodes on callback alternate mappings
closes #47
1 parent d7db997 commit df5c0de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/blink/cmp/keymap.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ function keymap.run_non_blink_keymap(mode, key)
9797
-- and is quite complex. we should look to see if we can simplify their logic
9898
-- https://github.com/hrsh7th/nvim-cmp/blob/ae644feb7b67bf1ce4260c231d1d4300b19c6f30/lua/cmp/utils/keymap.lua
9999
if type(mapping.callback) == 'function' then
100-
return mapping.callback()
100+
local expr = mapping.callback()
101+
if mapping.replace_keycodes then expr = vim.api.nvim_replace_termcodes(expr, true, true, true) end
102+
if mapping.expr then return expr end
101103
elseif mapping.rhs then
102104
return vim.api.nvim_eval(vim.api.nvim_replace_termcodes(mapping.rhs, true, true, true))
103105
end

0 commit comments

Comments
 (0)