fix(async): make asyncs abortable

This commit is contained in:
Folke Lemaitre 2024-06-30 13:35:11 +02:00
parent c882227f1f
commit 1fad61712b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
7 changed files with 29 additions and 8 deletions

View file

@ -93,7 +93,7 @@ function Process:_run()
end)
self:suspend()
while not (self.handle:is_closing() and stdout:is_closing() and stderr:is_closing()) do
coroutine.yield()
Async.yield()
end
else
self.data = "Failed to spawn process " .. self.cmd .. " " .. vim.inspect(self.opts)