patch 9.0.0447: using :echowin while at the hit-enter prompt causes problems
Problem: Using :echowin while at the hit-enter prompt causes problems.
Solution: Do not prompt for :echowin. Postpone showing the message window.
Start the timer when the window is displayed.
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 4a2deae..6dc9a5b 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -401,6 +401,28 @@
echowindow 'line' n
endfor
endfunc
+
+ def TwoMessages()
+ popup_clear()
+ set cmdheight=2
+ redraw
+ timer_start(100, (_) => {
+ echowin 'message'
+ })
+ echo 'one'
+ echo 'two'
+ enddef
+
+ def ThreeMessages()
+ popup_clear()
+ redraw
+ timer_start(100, (_) => {
+ echowin 'later message'
+ })
+ echo 'one'
+ echo 'two'
+ echo 'three'
+ enddef
END
call writefile(lines, 'XtestEchowindow')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
@@ -415,6 +437,16 @@
call term_sendkeys(buf, ":call ManyMessages()\<CR>")
call VerifyScreenDump(buf, 'Test_echowindow_4', {})
+ call term_sendkeys(buf, ":call TwoMessages()\<CR>")
+ call VerifyScreenDump(buf, 'Test_echowindow_5', {})
+
+ call term_sendkeys(buf, ":call ThreeMessages()\<CR>")
+ sleep 120m
+ call VerifyScreenDump(buf, 'Test_echowindow_6', {})
+
+ call term_sendkeys(buf, "\<CR>")
+ call VerifyScreenDump(buf, 'Test_echowindow_7', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestEchowindow')