Skip to content

Commit 2aa8e06

Browse files
committed
fix(config): dont start checker/change_detection when running headless
1 parent aa1c957 commit 2aa8e06

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

lua/lazy/core/config.lua

+30-30
Original file line numberDiff line numberDiff line change
@@ -272,44 +272,44 @@ function M.setup(opts)
272272
M.mapleader = vim.g.mapleader
273273
M.maplocalleader = vim.g.maplocalleader
274274

275-
if M.headless() then
276-
require("lazy.view.commands").setup()
277-
end
278-
279275
vim.api.nvim_create_autocmd("UIEnter", {
280276
once = true,
281277
callback = function()
282278
require("lazy.stats").on_ui_enter()
283279
end,
284280
})
285281

286-
vim.api.nvim_create_autocmd("User", {
287-
pattern = "VeryLazy",
288-
once = true,
289-
callback = function()
290-
require("lazy.view.commands").setup()
291-
if M.options.change_detection.enabled then
292-
require("lazy.manage.reloader").enable()
293-
end
294-
if M.options.checker.enabled then
295-
vim.defer_fn(function()
296-
require("lazy.manage.checker").start()
297-
end, 10)
298-
end
282+
if M.headless() then
283+
require("lazy.view.commands").setup()
284+
else
285+
vim.api.nvim_create_autocmd("User", {
286+
pattern = "VeryLazy",
287+
once = true,
288+
callback = function()
289+
require("lazy.view.commands").setup()
290+
if M.options.change_detection.enabled then
291+
require("lazy.manage.reloader").enable()
292+
end
293+
if M.options.checker.enabled then
294+
vim.defer_fn(function()
295+
require("lazy.manage.checker").start()
296+
end, 10)
297+
end
299298

300-
-- useful for plugin developers when making changes to a packspec file
301-
vim.api.nvim_create_autocmd("BufWritePost", {
302-
pattern = { "lazy.lua", "pkg.json", "*.rockspec" },
303-
callback = function()
304-
require("lazy").pkg({
305-
plugins = {
306-
require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/"),
307-
},
308-
})
309-
end,
310-
})
311-
end,
312-
})
299+
-- useful for plugin developers when making changes to a packspec file
300+
vim.api.nvim_create_autocmd("BufWritePost", {
301+
pattern = { "lazy.lua", "pkg.json", "*.rockspec" },
302+
callback = function()
303+
require("lazy").pkg({
304+
plugins = {
305+
require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/"),
306+
},
307+
})
308+
end,
309+
})
310+
end,
311+
})
312+
end
313313

314314
Util.very_lazy()
315315
end

0 commit comments

Comments
 (0)