mirror of https://github.com/folke/lazy.nvim.git
fix(ui): always clear complete tasks with the same name when starting a new task
This commit is contained in:
parent
5c0c381b56
commit
85e375223f
|
@ -9,7 +9,6 @@ local Process = require("lazy.manage.process")
|
||||||
---@class LazyTask
|
---@class LazyTask
|
||||||
---@field plugin LazyPlugin
|
---@field plugin LazyPlugin
|
||||||
---@field name string
|
---@field name string
|
||||||
---@field type string
|
|
||||||
---@field output string
|
---@field output string
|
||||||
---@field status string
|
---@field status string
|
||||||
---@field error? string
|
---@field error? string
|
||||||
|
@ -40,6 +39,10 @@ function Task.new(plugin, name, task, opts)
|
||||||
self.output = ""
|
self.output = ""
|
||||||
self.status = ""
|
self.status = ""
|
||||||
plugin._.tasks = plugin._.tasks or {}
|
plugin._.tasks = plugin._.tasks or {}
|
||||||
|
---@param other LazyTask
|
||||||
|
plugin._.tasks = vim.tbl_filter(function(other)
|
||||||
|
return other.name ~= name or other:is_running()
|
||||||
|
end, plugin._.tasks)
|
||||||
table.insert(plugin._.tasks, self)
|
table.insert(plugin._.tasks, self)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
|
@ -338,7 +338,6 @@ end
|
||||||
|
|
||||||
---@param task LazyTask
|
---@param task LazyTask
|
||||||
function M:log(task)
|
function M:log(task)
|
||||||
-- FIXME: only show last log task
|
|
||||||
local log = vim.trim(task.output)
|
local log = vim.trim(task.output)
|
||||||
if log ~= "" then
|
if log ~= "" then
|
||||||
local lines = vim.split(log, "\n")
|
local lines = vim.split(log, "\n")
|
||||||
|
|
Loading…
Reference in New Issue