fix: stuck input control if callback fails (#158)
This commit is contained in:
parent
572314728c
commit
3c38ac861e
|
@ -200,8 +200,10 @@ M.make_queued_async_fn = function(callback_arg_num, fn)
|
||||||
args[callback_arg_num] = function(...)
|
args[callback_arg_num] = function(...)
|
||||||
local cb_args = vim.F.pack_len(...)
|
local cb_args = vim.F.pack_len(...)
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
cb(vim.F.unpack_len(cb_args))
|
-- first schedule the consumption, only later invoke
|
||||||
|
-- the callback, because the callback could fail
|
||||||
vim.schedule(consume)
|
vim.schedule(consume)
|
||||||
|
cb(vim.F.unpack_len(cb_args))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
table.insert(queue, args)
|
table.insert(queue, args)
|
||||||
|
|
Loading…
Reference in New Issue