mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 03:24:13 +00:00
fix(task): run on_exit async. See #1569
This commit is contained in:
parent
461552474c
commit
60fe75c88d
3 changed files with 23 additions and 7 deletions
|
@ -197,7 +197,21 @@ function M.exec(cmd, opts)
|
|||
lines = _lines
|
||||
end,
|
||||
})
|
||||
vim.fn.jobwait({ job })
|
||||
|
||||
if job <= 0 then
|
||||
error("Failed to start job: " .. vim.inspect(cmd))
|
||||
end
|
||||
|
||||
local Async = require("lazy.async")
|
||||
local async = Async.current
|
||||
if async then
|
||||
while vim.fn.jobwait({ job }, 0)[1] == -1 do
|
||||
async:sleep(10)
|
||||
end
|
||||
else
|
||||
vim.fn.jobwait({ job })
|
||||
end
|
||||
|
||||
return lines
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue