mirror of
https://github.com/smoka7/hop.nvim.git
synced 2026-07-23 02:16:50 -04:00
21 lines
305 B
Lua
21 lines
305 B
Lua
local M = {}
|
|
|
|
---@alias char string
|
|
|
|
---@param seq char[]
|
|
function M.override_keyseq(seq, closure)
|
|
local mocked = vim.fn.getcharstr
|
|
|
|
local idx = 0
|
|
vim.fn.getcharstr = function()
|
|
idx = idx + 1
|
|
return seq[idx]
|
|
end
|
|
local r = closure()
|
|
|
|
vim.fn.getcharstr = mocked
|
|
return r
|
|
end
|
|
|
|
return M
|