mirror of https://github.com/folke/lazy.nvim.git
feat(ui): added section with disabled plugins
This commit is contained in:
parent
05aec48968
commit
299ffdfd53
|
@ -99,6 +99,7 @@ function Spec:add(plugin, results, is_dep)
|
||||||
self.plugins[plugin.name] = plugin
|
self.plugins[plugin.name] = plugin
|
||||||
return results and table.insert(results, plugin.name)
|
return results and table.insert(results, plugin.name)
|
||||||
else
|
else
|
||||||
|
plugin._.kind = "disabled"
|
||||||
self.disabled[plugin.name] = plugin
|
self.disabled[plugin.name] = plugin
|
||||||
self.plugins[plugin.name] = nil
|
self.plugins[plugin.name] = nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,7 +38,9 @@ function M.index(plugin)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.update()
|
function M.update()
|
||||||
|
if Config.plugins["lazy.nvim"] then
|
||||||
vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc")
|
vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc")
|
||||||
|
end
|
||||||
local docs = Config.options.readme.root .. "/doc"
|
local docs = Config.options.readme.root .. "/doc"
|
||||||
vim.fn.mkdir(docs, "p")
|
vim.fn.mkdir(docs, "p")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
---@alias LazyPluginKind "normal"|"clean"
|
---@alias LazyPluginKind "normal"|"clean"|"disabled"
|
||||||
|
|
||||||
---@class LazyPluginState
|
---@class LazyPluginState
|
||||||
---@field loaded? {[string]:string}|{time:number}
|
---@field loaded? {[string]:string}|{time:number}
|
||||||
|
|
|
@ -37,6 +37,7 @@ function M:update()
|
||||||
|
|
||||||
self.plugins = vim.tbl_values(Config.plugins)
|
self.plugins = vim.tbl_values(Config.plugins)
|
||||||
vim.list_extend(self.plugins, vim.tbl_values(Config.to_clean))
|
vim.list_extend(self.plugins, vim.tbl_values(Config.to_clean))
|
||||||
|
vim.list_extend(self.plugins, vim.tbl_values(Config.spec.disabled))
|
||||||
table.sort(self.plugins, function(a, b)
|
table.sort(self.plugins, function(a, b)
|
||||||
return a.name < b.name
|
return a.name < b.name
|
||||||
end)
|
end)
|
||||||
|
@ -99,6 +100,8 @@ function M:get_plugin(row)
|
||||||
return plugin
|
return plugin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif loc.kind == "disabled" then
|
||||||
|
return Config.spec.disabled[loc.name]
|
||||||
else
|
else
|
||||||
return Config.plugins[loc.name]
|
return Config.plugins[loc.name]
|
||||||
end
|
end
|
||||||
|
|
|
@ -83,7 +83,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter = function(plugin)
|
filter = function(plugin)
|
||||||
return not plugin._.installed
|
return not plugin._.installed and plugin._.kind ~= "disabled"
|
||||||
end,
|
end,
|
||||||
title = "Not Installed",
|
title = "Not Installed",
|
||||||
},
|
},
|
||||||
|
@ -99,4 +99,10 @@ return {
|
||||||
end,
|
end,
|
||||||
title = "Not Loaded",
|
title = "Not Loaded",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
filter = function(plugin)
|
||||||
|
return plugin._.kind == "disabled"
|
||||||
|
end,
|
||||||
|
title = "Disabled",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue