Skip to content

Commit

Permalink
fix(keys): feed keys instead of returning expr for Neovim 0.8.x. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 8, 2023
1 parent ddaffa0 commit c734d94
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lua/lazy/core/handler/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ end
function M:_add(keys)
local lhs = keys[1]
local opts = M.opts(keys)
opts.remap = true
opts.expr = true
opts.replace_keycodes = false
vim.keymap.set(keys.mode, lhs, function()
local plugins = self.active[keys.id]

Expand All @@ -76,8 +73,15 @@ function M:_add(keys)
Util.track({ keys = lhs })
Loader.load(plugins, { keys = lhs })
Util.track()
return vim.api.nvim_replace_termcodes("<Ignore>" .. lhs, false, true, true)
end, opts)

local feed = vim.api.nvim_replace_termcodes("<Ignore>" .. lhs, true, true, true)
-- insert instead of append the lhs
vim.api.nvim_feedkeys(feed, "i", false)
end, {
desc = opts.desc,
-- we do not return anything, but this is still needed to make operator pending mappings work
expr = true,
})
end

---@param keys LazyKeys
Expand Down

0 comments on commit c734d94

Please sign in to comment.