]> granicus.if.org Git - vim/commitdiff
patch 9.0.0307: :echomsg doesn't work properly with cmdheight=0 v9.0.0307
authorBram Moolenaar <Bram@vim.org>
Sun, 28 Aug 2022 20:36:43 +0000 (21:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 28 Aug 2022 20:36:43 +0000 (21:36 +0100)
Problem:    :echomsg doesn't work properly with cmdheight=0.
Solution:   Improve scrolling and displaying.

src/eval.c
src/ex_docmd.c
src/testdir/dumps/Test_cmdheight_zero_6.dump [new file with mode: 0644]
src/testdir/dumps/Test_cmdheight_zero_7.dump [new file with mode: 0644]
src/testdir/dumps/Test_cmdheight_zero_8.dump [new file with mode: 0644]
src/testdir/test_messages.vim
src/version.c

index 3d6d84c2bb4196b5d65818a019db743163edd288..8cd271640693a49310e8ffd5e35cb2ccdfa297b7 100644 (file)
@@ -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);
 }
 
index 89c9d26b0fc8a10a69090dc5c1b279d0d990a108..598c6b7c32ba64bd532d180f2c9888a00d488544 100644 (file)
@@ -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;
diff --git a/src/testdir/dumps/Test_cmdheight_zero_6.dump b/src/testdir/dumps/Test_cmdheight_zero_6.dump
new file mode 100644 (file)
index 0000000..7af84c9
--- /dev/null
@@ -0,0 +1,6 @@
+|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
diff --git a/src/testdir/dumps/Test_cmdheight_zero_7.dump b/src/testdir/dumps/Test_cmdheight_zero_7.dump
new file mode 100644 (file)
index 0000000..3c57623
--- /dev/null
@@ -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
diff --git a/src/testdir/dumps/Test_cmdheight_zero_8.dump b/src/testdir/dumps/Test_cmdheight_zero_8.dump
new file mode 100644 (file)
index 0000000..6dbd42c
--- /dev/null
@@ -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
index f714478efc61abbe855aca4a776c324eb581bd6d..8683adcf975cdcf99b8be44133c54537920929b5 100644 (file)
@@ -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')
index b69b74ad895261f03f297e7e2074377e86a7dd0d..80ce6fedeafe720a6e5d1260d1a2f9ea72ef37cb 100644 (file)
@@ -707,6 +707,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    307,
 /**/
     306,
 /**/