Skip to content

Commit

Permalink
fix(keys): feedkeys should include pending keys. Fixes #71
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 21, 2022
1 parent d34a02d commit 2ab6518
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/lazy/core/handler/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ function M:_add(keys)
vim.keymap.del("n", keys)
Util.track({ keys = keys })
Loader.load(self.active[keys], { keys = keys })
local feed = vim.api.nvim_replace_termcodes(keys, true, false, true)
local extra = ""
while true do
local c = vim.fn.getchar(0)
if c == 0 then
break
end
extra = extra .. vim.fn.nr2char(c)
end
local feed = vim.api.nvim_replace_termcodes(keys .. extra, true, true, true)
vim.api.nvim_feedkeys(feed, "m", false)
Util.track()
end, { silent = true })
Expand Down

0 comments on commit 2ab6518

Please sign in to comment.