From 85615eb2dac7e7c62db8448487a157df828c9bb3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 24 Sep 2022 15:25:08 +0200 Subject: [PATCH] fix: clear message statusline when message got cleared --- lua/noice/status.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/noice/status.lua b/lua/noice/status.lua index df3414d4..bbded01b 100644 --- a/lua/noice/status.lua +++ b/lua/noice/status.lua @@ -1,6 +1,6 @@ local M = {} -local function NoiceStatus() +local function NoiceStatus(empty_when_cleared) ---@type NoiceMessage? local message return { @@ -8,6 +8,9 @@ local function NoiceStatus() message = nil end, has = function() + if message and empty_when_cleared and not message.keep then + return false + end return message ~= nil end, set = function(m) @@ -32,7 +35,7 @@ local function NoiceStatus() end M.ruler = NoiceStatus() -M.message = NoiceStatus() +M.message = NoiceStatus(true) M.command = NoiceStatus() M.mode = NoiceStatus() M.search = NoiceStatus()