From bc6a9c600ae37c3bdb6549dee3cd1ed7ce44010c Mon Sep 17 00:00:00 2001 From: Maddison Hellstrom Date: Thu, 7 Mar 2024 20:52:35 -0800 Subject: [PATCH] feat: add incline.refresh() function (#58) --- doc/incline.txt | 3 +++ lua/incline/init.lua | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/doc/incline.txt b/doc/incline.txt index 999a0b5..707b71c 100644 --- a/doc/incline.txt +++ b/doc/incline.txt @@ -52,6 +52,9 @@ Incline is disabled by default. To enable it, you must call either `incline.is_enabled()` *incline.is_enabled()* Returns `true` if Incline is enabled, else `false`. + `incline.refresh()` *incline.refresh()* + Forces a re-render of all Incline statuslines on the current tabpage. + ------------------------------------------------------------------------------ 2.2 Configuration *incline-config* diff --git a/lua/incline/init.lua b/lua/incline/init.lua index 4c28170..9983dbd 100644 --- a/lua/incline/init.lua +++ b/lua/incline/init.lua @@ -31,4 +31,11 @@ M.setup = function(_config) M.enable() end +M.refresh = function() + if not M.is_enabled() then + return + end + manager.update { refresh = true } +end + return M