(u.range) do not fire events in from_motion
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m31s

This commit is contained in:
Jonathan Apodaca 2025-08-01 21:05:52 -06:00
parent 0978422a47
commit dcedd7c59b

View File

@ -181,6 +181,8 @@ function Range.from_motion(motion, opts)
_G.Range__from_motion_opfunc = function(ty)
_G.Range__from_motion_opfunc_captured_range = Range.from_op_func(ty)
end
local old_eventignore = vim.o.eventignore
vim.o.eventignore = 'all'
vim.go.operatorfunc = 'v:lua.Range__from_motion_opfunc'
vim.cmd {
cmd = 'normal',
@ -188,6 +190,7 @@ function Range.from_motion(motion, opts)
args = { ESC .. 'g@' .. motion },
mods = { silent = true },
}
vim.o.eventignore = old_eventignore
end)
local captured_range = _G.Range__from_motion_opfunc_captured_range