feat(ui): toggle to show plugin URLs on home page

This commit is contained in:
Alexander Bays 2024-04-26 15:38:46 -05:00
commit f9d3365c5f
7 changed files with 51 additions and 6 deletions

View file

@ -8,9 +8,11 @@ local ViewConfig = require("lazy.view.config")
---@class LazyViewState
---@field mode string
---@field urls boolean
---@field plugin? {name:string, kind?: LazyPluginKind}
local default_state = {
mode = "home",
urls = Config.options.ui.urls.enabled,
profile = {
threshold = 0,
sort_time_taken = false,
@ -29,6 +31,16 @@ function M.visible()
return M.view and M.view.win and vim.api.nvim_win_is_valid(M.view.win)
end
function M.urls()
if Config.headless() then
return
end
M.view = M.visible() and M.view or M.create()
M.view.state.urls = not M.view.state.urls
M.view:update()
end
---@param mode? string
function M.show(mode)
if Config.headless() then