From 4008b57d882065814ce27a0f32609d5ea437a6e9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 22 Jan 2023 14:30:12 +0100 Subject: [PATCH] fix(checker): make sure we show logs when only doing a fast check --- lua/lazy/manage/checker.lua | 9 ++++++++- lua/lazy/manage/init.lua | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/lazy/manage/checker.lua b/lua/lazy/manage/checker.lua index 7622812b..5798b4f2 100644 --- a/lua/lazy/manage/checker.lua +++ b/lua/lazy/manage/checker.lua @@ -13,7 +13,13 @@ M.reported = {} function M.start() M.fast_check() - M.schedule() + if M.schedule() > 0 then + Manage.log({ + show = false, + check = true, + concurrency = Config.options.checker.concurrency, + }) + end end function M.schedule() @@ -21,6 +27,7 @@ function M.schedule() local next_check = State.checker.last_check + Config.options.checker.frequency - os.time() next_check = math.max(next_check, 0) vim.defer_fn(M.check, next_check * 1000) + return next_check end ---@param opts? {report:boolean} report defaults to true diff --git a/lua/lazy/manage/init.lua b/lua/lazy/manage/init.lua index 9ffda733..c4a4da0f 100644 --- a/lua/lazy/manage/init.lua +++ b/lua/lazy/manage/init.lua @@ -136,13 +136,13 @@ function M.check(opts) }, opts) end ----@param opts? ManagerOpts +---@param opts? ManagerOpts | {check?:boolean} function M.log(opts) opts = M.opts(opts, { mode = "log" }) return M.run({ pipeline = { { "git.origin", check = true }, - "git.log", + { "git.log", check = opts.check }, }, plugins = function(plugin) return plugin.url and plugin._.installed