feat(plugin): allow some `lazy.nvim` spec props to be set by the user

This commit is contained in:
Folke Lemaitre 2022-12-29 00:49:38 +01:00
parent 9997523841
commit c8553ca44f
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 10 additions and 2 deletions

View File

@ -212,8 +212,15 @@ function M.load()
local spec = M.spec() local spec = M.spec()
-- add ourselves -- add ourselves
spec.plugins["lazy.nvim"] = nil spec:add({ "folke/lazy.nvim" })
spec:add({ "folke/lazy.nvim", lazy = true, dir = Config.me }) -- override some lazy props
local lazy = spec.plugins["lazy.nvim"]
lazy.lazy = true
lazy.dir = Config.me
lazy.config = function()
error("lazy config should not be called")
end
lazy._.loaded = {}
local existing = Config.plugins local existing = Config.plugins
Config.plugins = spec.plugins Config.plugins = spec.plugins
@ -228,6 +235,7 @@ function M.load()
Util.track("state") Util.track("state")
M.update_state() M.update_state()
Util.track() Util.track()
require("lazy.core.cache").indexed_unloaded = false
end end
-- Finds the plugin that has this path -- Finds the plugin that has this path