changeset 29938:935717599faa v9.0.0307

patch 9.0.0307: :echomsg doesn't work properly with cmdheight=0 Commit: https://github.com/vim/vim/commit/134b86553c12c46e0ae7d534f6fe65e8ba2d50bc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 28 21:36:43 2022 +0100 patch 9.0.0307: :echomsg doesn't work properly with cmdheight=0 Problem: :echomsg doesn't work properly with cmdheight=0. Solution: Improve scrolling and displaying.
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Aug 2022 22:45:03 +0200
parents 7d487d8594d3
children 6498ad24994d
files src/eval.c src/ex_docmd.c src/testdir/dumps/Test_cmdheight_zero_6.dump src/testdir/dumps/Test_cmdheight_zero_7.dump src/testdir/dumps/Test_cmdheight_zero_8.dump src/testdir/test_messages.vim src/version.c
diffstat 7 files changed, 55 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -6824,7 +6824,18 @@ ex_execute(exarg_T *eap)
 
     if (eap->skip)
 	--emsg_skip;
-
+#ifdef HAS_MESSAGE_WINDOW
+    if (use_message_window() && eap->cmdidx != CMD_execute)
+    {
+	// show the message window now
+	ex_redraw(eap);
+
+	// do not overwrite messages
+	msg_didout = TRUE;
+	if (msg_col == 0)
+	    msg_col = 1;
+    }
+#endif
     set_nextcmd(eap, arg);
 }
 
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8370,9 +8370,14 @@ ex_redraw(exarg_T *eap)
     // After drawing the statusline screen_attr may still be set.
     screen_stop_highlight();
 
-    // Reset msg_didout, so that a message that's there is overwritten.
-    msg_didout = FALSE;
-    msg_col = 0;
+#ifdef HAS_MESSAGE_WINDOW
+    if (!use_message_window())  // append messages in the message window
+#endif
+    {
+	// Reset msg_didout, so that a message that's there is overwritten.
+	msg_didout = FALSE;
+	msg_col = 0;
+    }
 
     // No need to wait after an intentional redraw.
     need_wait_return = FALSE;
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_cmdheight_zero_6.dump
@@ -0,0 +1,6 @@
+|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_cmdheight_zero_7.dump
@@ -0,0 +1,6 @@
+|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
+|~+0#4040ff13&| @73
+|~| @73
+|═+0#e000002&@74
+|s|o|m|e| |t|e|x|t| @65
+|s|o|m|e| |m|o|r|e| |t|e|x|t| @60
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_cmdheight_zero_8.dump
@@ -0,0 +1,6 @@
+|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
+|~+0#4040ff13&| @73
+|═+0#e000002&@74
+|s|o|m|e| |t|e|x|t| @65
+|s|o|m|e| |m|o|r|e| |t|e|x|t| @60
+|e|v|e|n| |m|o|r|e| |t|e|x|t| @60
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -478,6 +478,13 @@ func Test_cmdheight_zero_dump()
       set cmdheight=0
       set showmode
       call setline(1, 'some text')
+      func ShowMessages()
+        echomsg 'some text'
+        sleep 100m
+        echomsg 'some more text'
+        sleep 2500m
+        echomsg 'even more text'
+      endfunc
   END
   call writefile(lines, 'XtestCmdheight')
   let buf = RunVimInTerminal('-S XtestCmdheight', #{rows: 6})
@@ -501,6 +508,14 @@ func Test_cmdheight_zero_dump()
   call term_sendkeys(buf, ":w XsomeText\<CR>")
   call VerifyScreenDump(buf, 'Test_cmdheight_zero_5', {})
 
+  call term_sendkeys(buf, ":call popup_clear()\<CR>")
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_6', {})
+
+  call term_sendkeys(buf, ":call ShowMessages()\<CR>")
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_7', {})
+  sleep 2
+  call VerifyScreenDump(buf, 'Test_cmdheight_zero_8', {})
+
   " clean up
   call StopVimInTerminal(buf)
   call delete('XtestCmdheight')
--- a/src/version.c
+++ b/src/version.c
@@ -708,6 +708,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    307,
+/**/
     306,
 /**/
     305,