mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 19:34:15 +00:00
feat(ui): toggle to show plugin URLs on home page
This commit is contained in:
parent
3f13f08043
commit
f9d3365c5f
7 changed files with 51 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue