mirror of https://github.com/folke/lazy.nvim.git
fix: make sure we have ran on_exit before returning is_done=true
This commit is contained in:
parent
5d84967e9c
commit
782d287d89
|
@ -53,12 +53,7 @@ function Task:is_done()
|
|||
end
|
||||
|
||||
function Task:is_running()
|
||||
for _, state in ipairs(self._running) do
|
||||
if state() then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
return self:has_started() and self._ended == nil
|
||||
end
|
||||
|
||||
function Task:start()
|
||||
|
@ -78,9 +73,11 @@ end
|
|||
|
||||
---@private
|
||||
function Task:_check()
|
||||
if self:is_running() then
|
||||
for _, state in ipairs(self._running) do
|
||||
if state() then
|
||||
return
|
||||
end
|
||||
end
|
||||
self._ended = vim.loop.hrtime()
|
||||
if self._opts.on_done then
|
||||
self._opts.on_done(self)
|
||||
|
|
Loading…
Reference in New Issue