vim-patch:9.2.0985: Multiline messages not visible when mapping starts cmdline (#41405)

Problem:  Multiline messages exceeding 'cmdheight' not visible when a
          mapping starts cmdline immediately after it (after 9.2.0967).
Solution: Revert patch 9.2.0967 and use a different solution (zeertzjq).

fixes:  vim/vim#21098
closes: vim/vim#21101

fb4866a2dd
This commit is contained in:
zeertzjq
2026-08-21 07:46:34 +08:00
committed by GitHub
parent 2dd6e9d6a2
commit af37d459a6
3 changed files with 48 additions and 20 deletions

View File

@@ -889,15 +889,15 @@ describe('messages', function()
]])
end)
-- oldtest: Test_hit_enter_no_eat_mapped_keys()
it('hit-enter prompt does not eat keys from a mapping', function()
-- oldtest: Test_hit_enter_during_mapping()
it('hit-enter prompt during a mapping', function()
screen = Screen.new(75, 10)
exec([[
set ruler more
set ruler
call setline(1, range(1, 20))
" The 8-line :echo scrolls the screen and would raise a hit-enter prompt;
" the mapping then runs "gg" to move the cursor to line 1.
" The 8-line :echo leads to a hit-enter prompt.
nnoremap X :echo "a\nb\nc\nd\ne\nf\ng\nh"<CR>gg
nnoremap \b :echo "a\nb\nc\nd\ne\nf\ng\nh"<CR>:b<Space>
normal! 10G
]])
t.eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
@@ -908,6 +908,22 @@ describe('messages', function()
-- cursor stays put. With the fix "gg" runs and moves the cursor to line 1.
t.eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
t.eq({ 1, 0 }, api.nvim_win_get_cursor(0))
-- If a mapping starts cmdline after multiline messages exceeding 'cmdheight',
-- the messages should still be visible.
feed('\\b')
screen:expect([[
{3: }|
a |
b |
c |
d |
e |
f |
g |
h |
:b ^ |
]])
end)
-- oldtest: Test_fileinfo_after_last_bd()