From 2ab651864f30022751252e66b4cd2c1e36800d06 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 21 Dec 2022 19:01:58 +0100 Subject: [PATCH] fix(keys): feedkeys should include pending keys. Fixes #71 --- lua/lazy/core/handler/keys.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/handler/keys.lua b/lua/lazy/core/handler/keys.lua index 34f8ea9..e6bf6f2 100644 --- a/lua/lazy/core/handler/keys.lua +++ b/lua/lazy/core/handler/keys.lua @@ -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 })