Skip to content

Commit

Permalink
feat: dont run setup again when a user re-sources their config & show…
Browse files Browse the repository at this point in the history
… a warning
  • Loading branch information
folke committed Dec 3, 2022
1 parent 3f517ab commit 7b945ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lazy/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ local M = {}
---@param spec LazySpec Should be a module name to load, or a plugin spec
---@param opts? LazyConfig
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
end
vim.g.lazy_did_setup = true
local start = vim.loop.hrtime()

if not (opts and opts.performance and opts.performance.cache and opts.performance.cache.enabled == false) then
Expand Down

0 comments on commit 7b945ee

Please sign in to comment.