feat(build): build files and functions are now async. use coroutine.yield to interrupt and report progress

This commit is contained in:
Folke Lemaitre 2024-06-24 14:16:00 +02:00
parent fcfd54835d
commit 368747bc9a
4 changed files with 102 additions and 38 deletions

View file

@ -231,6 +231,18 @@ function M.markdown(msg, opts)
)
end
---@async
---@param ms number
function M.sleep(ms)
local continue = false
vim.defer_fn(function()
continue = true
end, ms)
while not continue do
coroutine.yield()
end
end
function M._dump(value, result)
local t = type(value)
if t == "number" or t == "boolean" then