Skip to content

Commit

Permalink
fix: clear message statusline when message got cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 28, 2022
1 parent 7aab487 commit 85615eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/noice/status.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
local M = {}

local function NoiceStatus()
local function NoiceStatus(empty_when_cleared)
---@type NoiceMessage?
local message
return {
clear = function()
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)
Expand All @@ -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()
Expand Down

0 comments on commit 85615eb

Please sign in to comment.