diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 59eb4dd..a277475 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -54,7 +54,7 @@ M.defaults = { checker = { -- lazy can automatically check for updates enabled = false, - concurrency = 10, -- set to 1 to very slowly check for updates + concurrency = nil, ---@type number? set to 1 to very slowly check for updates notify = true, -- get a notification if new updates are found frequency = 3600, -- every hour }, diff --git a/lua/lazy/manage/checker.lua b/lua/lazy/manage/checker.lua index ee0dabd..98e2f1b 100644 --- a/lua/lazy/manage/checker.lua +++ b/lua/lazy/manage/checker.lua @@ -7,6 +7,7 @@ local M = {} M.running = false M.updated = {} +M.reported = {} function M.start() M.fast_check() @@ -15,6 +16,7 @@ end function M.fast_check() for _, plugin in pairs(Config.plugins) do + plugin._.has_updates = nil local info = Git.info(plugin.dir) local target = Git.get_target(plugin) if info and target and info.commit ~= target.commit then @@ -36,10 +38,14 @@ end function M.report() local lines = {} + M.updated = {} for _, plugin in pairs(Config.plugins) do - if plugin._.has_updates and not vim.tbl_contains(M.updated, plugin.name) then - table.insert(lines, "- **" .. plugin.name .. "**") + if plugin._.has_updates then table.insert(M.updated, plugin.name) + if not vim.tbl_contains(M.reported, plugin.name) then + table.insert(lines, "- **" .. plugin.name .. "**") + table.insert(M.reported, plugin.name) + end end end if #lines > 0 and Config.options.checker.notify then diff --git a/lua/lazy/manage/init.lua b/lua/lazy/manage/init.lua index 2332d1e..cd801c5 100644 --- a/lua/lazy/manage/init.lua +++ b/lua/lazy/manage/init.lua @@ -43,6 +43,7 @@ function M.run(ropts, opts) runner:wait(function() vim.cmd([[do User LazyRender]]) Plugin.update_state() + require("lazy.manage.checker").fast_check() end) if opts.wait then