fix(ui2): preserve Visual mode messages #40828

Problem:
The existing `showmode` overlay can immediately cover messages emitted while
Visual mode is active, including the `g CTRL-G` word count.

Solution:
Protect Visual mode messages with the existing message delay and temporarily
hide the previous last-line overlay until it is restored.
This commit is contained in:
Barrett Ruth
2026-07-20 14:44:37 -05:00
committed by GitHub
parent d343a1e230
commit 16c145d240
2 changed files with 31 additions and 3 deletions

View File

@@ -448,6 +448,27 @@ describe('messages2', function()
]])
end)
it('showmode does not overwrite Visual word count #40824', function()
if t.is_os('win') then
pending('FIXME #40843')
end
api.nvim_buf_set_lines(0, 0, -1, true, { 'one two', 'three four' })
feed('Vj')
screen:expect([[
{17:one two} |
^t{17:hree four} |
{1:~ }|*11
{5:-- VISUAL LINE --} |
]])
feed('g<C-G>')
screen:expect([[
{17:one two} |
^t{17:hree four} |
{1:~ }|*11
Selected 2 of 2 Lines; 4 of 4 Words; 19 of 19 Bytes |
]])
end)
it('hit-enter prompt does not error for invalid window #35095', function()
command('echo "foo\nbar"')
screen:expect([[