mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: lots of improvements to pipeline runner and converted all tasks to new system
This commit is contained in:
parent
4de10f9578
commit
fb84c081b0
13 changed files with 381 additions and 200 deletions
|
@ -69,10 +69,12 @@ function M.show()
|
|||
|
||||
local render = Render.new(buf, win, 2)
|
||||
local update = Util.throttle(30, function()
|
||||
vim.bo[buf].modifiable = true
|
||||
render:update()
|
||||
vim.bo[buf].modifiable = false
|
||||
vim.cmd.redraw()
|
||||
if buf and vim.api.nvim_buf_is_valid(buf) then
|
||||
vim.bo[buf].modifiable = true
|
||||
render:update()
|
||||
vim.bo[buf].modifiable = false
|
||||
vim.cmd.redraw()
|
||||
end
|
||||
end)
|
||||
|
||||
local function get_plugin()
|
||||
|
|
|
@ -219,11 +219,11 @@ function M:diagnostics(plugin)
|
|||
if task:is_running() then
|
||||
self:diagnostic({
|
||||
severity = vim.diagnostic.severity.WARN,
|
||||
message = task.type .. (task.status == "" and "" or (": " .. task.status)),
|
||||
message = task.name .. (task.status == "" and "" or (": " .. task.status)),
|
||||
})
|
||||
elseif task.error then
|
||||
self:diagnostic({
|
||||
message = task.type .. " failed",
|
||||
message = task.name .. " failed",
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
})
|
||||
end
|
||||
|
@ -250,7 +250,12 @@ end
|
|||
---@param plugin LazyPlugin
|
||||
function M:tasks(plugin)
|
||||
for _, task in ipairs(plugin._.tasks or {}) do
|
||||
if task.type == "log" and not task.error then
|
||||
if self._details == plugin.name then
|
||||
self:append("✔ [task] ", "Title", { indent = 4 }):append(task.name)
|
||||
self:append(" " .. math.floor((task:time()) * 100) / 100 .. "ms", "Bold")
|
||||
self:nl()
|
||||
end
|
||||
if task.name == "log" and not task.error then
|
||||
self:log(task)
|
||||
elseif task.error or self._details == plugin.name then
|
||||
if task.error then
|
||||
|
|
|
@ -33,7 +33,7 @@ return {
|
|||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
if task.type ~= "log" then
|
||||
if task.name ~= "log" then
|
||||
return
|
||||
end
|
||||
local lines = vim.split(task.output, "\n")
|
||||
|
@ -53,10 +53,17 @@ return {
|
|||
end,
|
||||
title = "Updated",
|
||||
},
|
||||
{
|
||||
---@param plugin LazyPlugin
|
||||
filter = function(plugin)
|
||||
return plugin._.cloned
|
||||
end,
|
||||
title = "Installed",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
return task.type == "log" and vim.trim(task.output) ~= ""
|
||||
return task.name == "log" and vim.trim(task.output) ~= ""
|
||||
end)
|
||||
end,
|
||||
title = "Log",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue