fix(ui): don't show output when it's the same as error

This commit is contained in:
Folke Lemaitre 2024-06-26 07:15:04 +02:00
parent 28e435b7f3
commit e79805d706
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 24 additions and 20 deletions

View File

@ -472,7 +472,7 @@ function M:tasks(plugin)
if not task.error and not task.warn and task.name == "log" then if not task.error and not task.warn and task.name == "log" then
self:log(task) self:log(task)
end end
if self.view:is_selected(plugin) or (task.error or task.warn) then if (self.view:is_selected(plugin) or (task.error or task.warn)) and task.output ~= task.error then
self:markdown(vim.trim(task.output), "LazyTaskOutput", { indent = 6 }) self:markdown(vim.trim(task.output), "LazyTaskOutput", { indent = 6 })
end end
end end
@ -485,6 +485,7 @@ function M:log(task)
local lines = vim.split(log, "\n") local lines = vim.split(log, "\n")
for _, line in ipairs(lines) do for _, line in ipairs(lines) do
local ref, msg, time = line:match("^(%w+) (.*) (%(.*%))$") local ref, msg, time = line:match("^(%w+) (.*) (%(.*%))$")
if msg then
if msg:find("^%S+!:") then if msg:find("^%S+!:") then
self:diagnostic({ message = "Breaking Changes", severity = vim.diagnostic.severity.WARN }) self:diagnostic({ message = "Breaking Changes", severity = vim.diagnostic.severity.WARN })
end end
@ -506,6 +507,9 @@ function M:log(task)
}) })
self:append(" " .. time, "LazyComment") self:append(" " .. time, "LazyComment")
self:nl() self:nl()
-- else
-- self:append(line, "LazyTaskOutput", { indent = 6 }):nl()
end
end end
self:nl() self:nl()
end end