(u.range) do not fire events in from_motion
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m31s
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m31s
This commit is contained in:
parent
0978422a47
commit
dcedd7c59b
@ -181,6 +181,8 @@ function Range.from_motion(motion, opts)
|
|||||||
_G.Range__from_motion_opfunc = function(ty)
|
_G.Range__from_motion_opfunc = function(ty)
|
||||||
_G.Range__from_motion_opfunc_captured_range = Range.from_op_func(ty)
|
_G.Range__from_motion_opfunc_captured_range = Range.from_op_func(ty)
|
||||||
end
|
end
|
||||||
|
local old_eventignore = vim.o.eventignore
|
||||||
|
vim.o.eventignore = 'all'
|
||||||
vim.go.operatorfunc = 'v:lua.Range__from_motion_opfunc'
|
vim.go.operatorfunc = 'v:lua.Range__from_motion_opfunc'
|
||||||
vim.cmd {
|
vim.cmd {
|
||||||
cmd = 'normal',
|
cmd = 'normal',
|
||||||
@ -188,6 +190,7 @@ function Range.from_motion(motion, opts)
|
|||||||
args = { ESC .. 'g@' .. motion },
|
args = { ESC .. 'g@' .. motion },
|
||||||
mods = { silent = true },
|
mods = { silent = true },
|
||||||
}
|
}
|
||||||
|
vim.o.eventignore = old_eventignore
|
||||||
end)
|
end)
|
||||||
local captured_range = _G.Range__from_motion_opfunc_captured_range
|
local captured_range = _G.Range__from_motion_opfunc_captured_range
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user