Skip to content

Commit

Permalink
fix(ui): always clear complete tasks with the same name when starting…
Browse files Browse the repository at this point in the history
… a new task
  • Loading branch information
folke committed Dec 17, 2022
1 parent 5c0c381 commit 85e3752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lua/lazy/manage/task/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ local Process = require("lazy.manage.process")
---@class LazyTask
---@field plugin LazyPlugin
---@field name string
---@field type string
---@field output string
---@field status string
---@field error? string
Expand Down Expand Up @@ -40,6 +39,10 @@ function Task.new(plugin, name, task, opts)
self.output = ""
self.status = ""
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)
return self
end
Expand Down
1 change: 0 additions & 1 deletion lua/lazy/view/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ end

---@param task LazyTask
function M:log(task)
-- FIXME: only show last log task
local log = vim.trim(task.output)
if log ~= "" then
local lines = vim.split(log, "\n")
Expand Down

0 comments on commit 85e3752

Please sign in to comment.