diff src/testdir/test_messages.vim @ 29912:c9ff1715f03d v9.0.0294

patch 9.0.0294: crash when 'cmdheight' is 0 and popup_clear() used Commit: https://github.com/vim/vim/commit/43568648dfefe5796dc3fe8fe711135eb20d9eb6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 28 13:02:45 2022 +0100 patch 9.0.0294: crash when 'cmdheight' is 0 and popup_clear() used Problem: Crash when 'cmdheight' is 0 and popup_clear() used. Solution: Reset "message_win" when the message popup is cleared. Close the popup when 'cmdheight' is non-zero. Add a screendump test.
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Aug 2022 14:15:03 +0200
parents 24fd6fbcd0c0
children cf55d7e10bb1
line wrap: on
line diff
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -471,4 +471,32 @@ func Test_cmdheight_zero()
   redraw
 endfunc
 
+func Test_cmdheight_zero_dump()
+  CheckScreendump
+
+  let lines =<< trim END
+      set cmdheight=0
+      set showmode
+      call setline(1, 'some text')
+  END
+  call writefile(lines, 'XtestCmdheight')
+  let buf = RunVimInTerminal('-S XtestCmdheight', #{rows: 6})
+  " The "-- INSERT --" indicator should not be visible.
+  call term_sendkeys(buf, "i")
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_1', {})
+
+  " The "-- VISUAL --" indicator should not be visible.
+  call term_sendkeys(buf, "\<Esc>vw")
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_2', {})
+
+  " Echo'd text is in a popup window
+  call term_sendkeys(buf, "\<Esc>:echo 'message window'\<CR>")
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_3', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XtestCmdheight')
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab