mirror of https://github.com/folke/lazy.nvim.git
refactor: cleanup sections and fixed handlers in view
This commit is contained in:
parent
6dc45ada55
commit
08f4804916
|
@ -1,7 +1,7 @@
|
|||
local Config = require("lazy.core.config")
|
||||
local Util = require("lazy.util")
|
||||
local Sections = require("lazy.view.sections")
|
||||
local Loader = require("lazy.core.loader")
|
||||
local Handler = require("lazy.core.handler")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
|
||||
local Text = require("lazy.view.text")
|
||||
|
@ -303,11 +303,11 @@ function M:details(plugin)
|
|||
table.insert(props, { "readme", "README.md" })
|
||||
end
|
||||
|
||||
for _, loader in ipairs(Loader.types) do
|
||||
if plugin[loader] then
|
||||
for handler in ipairs(Handler.handlers) do
|
||||
if plugin[handler] then
|
||||
table.insert(props, {
|
||||
loader,
|
||||
type(plugin[loader]) == "string" and plugin[loader] or table.concat(plugin[loader], ", "),
|
||||
handler,
|
||||
type(plugin[handler]) == "string" and plugin[handler] or table.concat(plugin[handler], ", "),
|
||||
"@string",
|
||||
})
|
||||
end
|
||||
|
|
|
@ -22,44 +22,13 @@ return {
|
|||
end,
|
||||
title = "Failed",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
return task.running and task.type == "install"
|
||||
end)
|
||||
end,
|
||||
title = "Installing",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
return task.running and task.type == "update"
|
||||
end)
|
||||
end,
|
||||
title = "Updating",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
return task.running and task.type == "clean"
|
||||
end)
|
||||
end,
|
||||
title = "Cleaning",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
return task.running
|
||||
end)
|
||||
end,
|
||||
title = "Running",
|
||||
},
|
||||
{
|
||||
---@param plugin LazyPlugin
|
||||
filter = function(plugin)
|
||||
return plugin.updated and plugin.updated.from ~= plugin.updated.to
|
||||
end,
|
||||
title = "Updated",
|
||||
title = "Working",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
|
@ -77,6 +46,13 @@ return {
|
|||
end,
|
||||
title = "Breaking Changes",
|
||||
},
|
||||
{
|
||||
---@param plugin LazyPlugin
|
||||
filter = function(plugin)
|
||||
return plugin.updated and plugin.updated.from ~= plugin.updated.to
|
||||
end,
|
||||
title = "Updated",
|
||||
},
|
||||
{
|
||||
filter = function(plugin)
|
||||
return has_task(plugin, function(task)
|
||||
|
|
Loading…
Reference in New Issue