Improve resolve confirm

This commit is contained in:
hrsh7th
2021-09-13 19:09:45 +09:00
parent 71b9ebd019
commit dc0bbfe10b
2 changed files with 21 additions and 3 deletions

View File

@@ -55,4 +55,15 @@ async.dedup = function()
end
end
---Convert async process as sync
async.sync = function(runner, timeout)
local done = false
runner(function()
done = true
end)
vim.wait(timeout, function()
return done
end, 10, false)
end
return async