Skip to content

Commit

Permalink
fix(msg): clear existing confirm messages. Fixes #302
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 15, 2024
1 parent 3638abc commit d3d8329
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/noice/ui/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ function M.on_confirm(event, kind, content)
if State.skip(event, kind, content) then
return
end
local prev = Manager.get({ event = event, kind = kind }, { history = true })[1]
if prev then
Manager.remove(prev)
end
local message = Message(event, kind, content)
if not message:content():find("%s+$") then
message:append(" ")
Expand Down

0 comments on commit d3d8329

Please sign in to comment.