From 315be83afc96f5dd1f76f943de1be7d2429b5bf7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 5 Dec 2022 20:49:45 +0100 Subject: [PATCH] feat(ui): added statusline component to show pending updates --- lua/lazy/status.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lua/lazy/status.lua diff --git a/lua/lazy/status.lua b/lua/lazy/status.lua new file mode 100644 index 00000000..94e9575b --- /dev/null +++ b/lua/lazy/status.lua @@ -0,0 +1,16 @@ +local Config = require("lazy.core.config") + +local M = {} + +function M.updates() + local Checker = require("lazy.manage.checker") + local updates = #Checker.updated + return updates > 0 and (Config.options.ui.icons.plugin .. "" .. updates) +end + +function M.has_updates() + local Checker = require("lazy.manage.checker") + return #Checker.updated > 0 +end + +return M