fix(keys): feedkeys should include pending keys. Fixes #71

This commit is contained in:
Folke Lemaitre 2022-12-21 19:01:58 +01:00
parent d34a02d7b2
commit 2ab651864f
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 9 additions and 1 deletions

View File

@ -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 })