fix(ui2): clear showcmd virt_text together with search count

Problem: when the search count is displayed, the showcmd virt_text is
set to 11 empty spaces to ensure a consistent distance between search
count and ruler, or screen edge in case of noruler. But when the search
count is removed to make place for a message, the empty dummy showcmd
remains and unnecessarily erases part of the message.

Solution: properly remove showcmd together with search count.
This commit is contained in:
Sébastien Hoffmann
2026-07-05 11:06:46 +02:00
parent 5b455a8aa0
commit fcc391d89a
2 changed files with 14 additions and 3 deletions

View File

@@ -462,6 +462,7 @@ function M.msg_show(kind, content, replace_last, _, append, id, trigger)
M.cmd.last_emsg = (kind == 'emsg' or kind == 'wmsg') and os.time() or M.cmd.last_emsg
-- Should clear the search count now, mark itself is cleared by invalidate.
M.virt.last[M.virt.idx.search][1] = nil
M.virt.last[M.virt.idx.cmd] = {}
end
-- When message was emitted below an already expanded cmdline, move and route to pager.
tgt = ui.cmd.expand > 0 and 'pager' or tgt