Skip to content

Commit c734d94

Browse files
committed
fix(keys): feed keys instead of returning expr for Neovim 0.8.x. Fixes #511
1 parent ddaffa0 commit c734d94

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lua/lazy/core/handler/keys.lua

+9-5
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ end
6363
function M:_add(keys)
6464
local lhs = keys[1]
6565
local opts = M.opts(keys)
66-
opts.remap = true
67-
opts.expr = true
68-
opts.replace_keycodes = false
6966
vim.keymap.set(keys.mode, lhs, function()
7067
local plugins = self.active[keys.id]
7168

@@ -76,8 +73,15 @@ function M:_add(keys)
7673
Util.track({ keys = lhs })
7774
Loader.load(plugins, { keys = lhs })
7875
Util.track()
79-
return vim.api.nvim_replace_termcodes("<Ignore>" .. lhs, false, true, true)
80-
end, opts)
76+
77+
local feed = vim.api.nvim_replace_termcodes("<Ignore>" .. lhs, true, true, true)
78+
-- insert instead of append the lhs
79+
vim.api.nvim_feedkeys(feed, "i", false)
80+
end, {
81+
desc = opts.desc,
82+
-- we do not return anything, but this is still needed to make operator pending mappings work
83+
expr = true,
84+
})
8185
end
8286

8387
---@param keys LazyKeys

0 commit comments

Comments
 (0)