From c8553ca44fefb934ebedb1fabba3ca492848fccc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 29 Dec 2022 00:49:38 +0100 Subject: [PATCH] feat(plugin): allow some `lazy.nvim` spec props to be set by the user --- lua/lazy/core/plugin.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index c20bd9a..d81070f 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -212,8 +212,15 @@ function M.load() local spec = M.spec() -- add ourselves - spec.plugins["lazy.nvim"] = nil - spec:add({ "folke/lazy.nvim", lazy = true, dir = Config.me }) + spec:add({ "folke/lazy.nvim" }) + -- 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 Config.plugins = spec.plugins @@ -228,6 +235,7 @@ function M.load() Util.track("state") M.update_state() Util.track() + require("lazy.core.cache").indexed_unloaded = false end -- Finds the plugin that has this path