From 3e3fb7141ebecea12e2859e751559a4b0ffae561 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Mon, 24 Aug 2026 09:15:53 +0200 Subject: [PATCH] [NVIM] Keep update notices visible --- nvim/init.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nvim/init.vim b/nvim/init.vim index c3ced33..a23182c 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -97,8 +97,21 @@ local function check_plugin_updates() return command end + local function set_airline_status(message) + vim.g.plugin_update_status = message + local marker = '%{get(g:,"plugin_update_status","")}' + local warning = vim.g.airline_section_warning or '' + if not string.find(warning, 'plugin_update_status', 1, true) then + vim.g.airline_section_warning = warning .. ' ' .. marker + end + if vim.fn.exists(':AirlineRefresh') == 2 then + vim.cmd('AirlineRefresh') + end + end + local function report() if #updates > 0 then + set_airline_status(string.format('[updates: %d]', #updates)) local message = string.format( '%d plugin update%s available: %s', #updates, @@ -110,11 +123,13 @@ local function check_plugin_updates() end vim.notify(message, failures > 0 and vim.log.levels.WARN or vim.log.levels.INFO) elseif failures > 0 then + set_airline_status('[update check failed]') vim.notify( string.format('Plugin update check incomplete: %d check%s failed', failures, failures == 1 and '' or 's'), vim.log.levels.WARN ) else + set_airline_status('') vim.notify('All plugins up-to-date', vim.log.levels.INFO) end end