mirror of https://github.com/folke/lazy.nvim.git
fix(keys): don't escape pendig keys twice and only convert when number
This commit is contained in:
parent
9a2ecc8750
commit
46280a191b
|
@ -16,13 +16,15 @@ local M = {}
|
||||||
function M.retrigger(keys)
|
function M.retrigger(keys)
|
||||||
local pending = ""
|
local pending = ""
|
||||||
while true do
|
while true do
|
||||||
|
---@type number|string
|
||||||
local c = vim.fn.getchar(0)
|
local c = vim.fn.getchar(0)
|
||||||
if c == 0 then
|
if c == 0 then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
pending = pending .. vim.fn.nr2char(c)
|
c = type(c) == "number" and vim.fn.nr2char(c) or c
|
||||||
|
pending = pending .. c
|
||||||
end
|
end
|
||||||
local feed = vim.api.nvim_replace_termcodes(keys .. pending, true, true, true)
|
local feed = vim.api.nvim_replace_termcodes(keys, true, false, true) .. pending
|
||||||
vim.api.nvim_feedkeys(feed, "m", false)
|
vim.api.nvim_feedkeys(feed, "m", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue