fix(keys): make operator pending mode work. Fixes #286

This commit is contained in:
Folke Lemaitre 2023-01-03 11:16:15 +01:00
parent 299ffdfd53
commit cdb998c6fe
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,9 @@ function M.retrigger(keys)
c = type(c) == "number" and vim.fn.nr2char(c) or c c = type(c) == "number" and vim.fn.nr2char(c) or c
pending = pending .. c pending = pending .. c
end end
if op and op ~= "" then
keys = "<esc>" .. op .. keys
end
local feed = vim.api.nvim_replace_termcodes(keys, true, false, true) .. pending local feed = vim.api.nvim_replace_termcodes(keys, true, false, true) .. pending
if vim.v.count ~= 0 then if vim.v.count ~= 0 then
feed = vim.v.count .. feed feed = vim.v.count .. feed