mirror of https://github.com/folke/lazy.nvim.git
feat: dont run setup again when a user re-sources their config & show a warning
This commit is contained in:
parent
3f517abfa4
commit
7b945eec58
|
@ -3,9 +3,11 @@ local M = {}
|
||||||
---@param spec LazySpec Should be a module name to load, or a plugin spec
|
---@param spec LazySpec Should be a module name to load, or a plugin spec
|
||||||
---@param opts? LazyConfig
|
---@param opts? LazyConfig
|
||||||
function M.setup(spec, opts)
|
function M.setup(spec, opts)
|
||||||
if not vim.go.loadplugins then
|
if not vim.go.loadplugins or vim.g.lazy_did_setup then
|
||||||
|
vim.notify("Re-sourcing your config is not supported with lazy.nvim", vim.log.levels.WARN, { title = "lazy.nvim" })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
vim.g.lazy_did_setup = true
|
||||||
local start = vim.loop.hrtime()
|
local start = vim.loop.hrtime()
|
||||||
|
|
||||||
if not (opts and opts.performance and opts.performance.cache and opts.performance.cache.enabled == false) then
|
if not (opts and opts.performance and opts.performance.cache and opts.performance.cache.enabled == false) then
|
||||||
|
|
Loading…
Reference in New Issue