diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 9ddbfa3..9ef5c42 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -58,6 +58,11 @@ M.defaults = { notify = true, -- get a notification when new updates are found frequency = 3600, -- check for updates every hour }, + change_detection = { + -- automatically check for config file changes and reload the ui + enabled = true, + notify = true, -- get a notification when changes are found + }, performance = { ---@type LazyCacheConfig cache = nil, @@ -145,7 +150,9 @@ function M.setup(spec, opts) callback = function() require("lazy.core.cache").autosave() require("lazy.view").setup() - require("lazy.manage.reloader").enable() + if M.options.change_detection.enabled then + require("lazy.manage.reloader").enable() + end if M.options.checker.enabled then require("lazy.manage.checker").start() end diff --git a/lua/lazy/manage/reloader.lua b/lua/lazy/manage/reloader.lua index 61d4407..3b0af3c 100644 --- a/lua/lazy/manage/reloader.lua +++ b/lua/lazy/manage/reloader.lua @@ -68,11 +68,13 @@ function M.check(start) if not (start or #changes == 0) then vim.schedule(function() - local lines = { "# Config Change Detected. Reloading...", "" } - for _, change in ipairs(changes) do - table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`") + if Config.options.change_detection.notify then + local lines = { "# Config Change Detected. Reloading...", "" } + for _, change in ipairs(changes) do + table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`") + end + Util.warn(lines) end - Util.warn(lines) Plugin.load() vim.cmd([[do User LazyRender]]) end)