diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 89a89bd..d5c21b0 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -311,11 +311,10 @@ function M.setup(opts) vim.api.nvim_create_autocmd("BufWritePost", { pattern = { "lazy.lua", "pkg.json", "*.rockspec" }, callback = function() - require("lazy").pkg({ - plugins = { - require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/"), - }, - }) + local plugin = require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/") + if plugin then + require("lazy").pkg({ plugins = { plugin } }) + end end, }) end,