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
|
end
|
||||||
|
|
||||||
function Task:is_running()
|
function Task:is_running()
|
||||||
for _, state in ipairs(self._running) do
|
return self:has_started() and self._ended == nil
|
||||||
if state() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Task:start()
|
function Task:start()
|
||||||
|
@ -78,8 +73,10 @@ end
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
function Task:_check()
|
function Task:_check()
|
||||||
if self:is_running() then
|
for _, state in ipairs(self._running) do
|
||||||
return
|
if state() then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self._ended = vim.loop.hrtime()
|
self._ended = vim.loop.hrtime()
|
||||||
if self._opts.on_done then
|
if self._opts.on_done then
|
||||||
|
|
Loading…
Reference in New Issue