changeset 30431:8a25c8215d4a v9.0.0551

patch 9.0.0551: mode message is delayed when :echowin was used Commit: https://github.com/vim/vim/commit/f87eeb43fb29f5e3d39807e6ce49e5e2d72eb38b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 22 19:02:38 2022 +0100 patch 9.0.0551: mode message is delayed when :echowin was used Problem: Mode message is delayed when :echowin was used. (Maxim Kim) Solution: Save and restore msg_didout in :echowin. (closes https://github.com/vim/vim/issues/11193)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Sep 2022 20:15:04 +0200
parents 52a92d30b10b
children 8b800cb5fb8b
files src/popupwin.c src/version.c
diffstat 2 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -4557,6 +4557,13 @@ popup_hide_message_win(void)
 	popup_hide(message_win);
 }
 
+// Values saved in start_echowindow() and restored in end_echowindow()
+static int save_msg_didout = FALSE;
+static int save_msg_col = 0;
+// Values saved in end_echowindow() and restored in start_echowindow()
+static int ew_msg_didout = FALSE;
+static int ew_msg_col = 0;
+
 /*
  * Invoked before outputting a message for ":echowindow".
  */
@@ -4564,6 +4571,10 @@ popup_hide_message_win(void)
 start_echowindow(void)
 {
     in_echowindow = TRUE;
+    save_msg_didout = msg_didout;
+    save_msg_col = msg_col;
+    msg_didout = ew_msg_didout;
+    msg_col = ew_msg_col;
 }
 
 /*
@@ -4579,10 +4590,10 @@ end_echowindow(void)
 	redraw_cmd(FALSE);
 
     // do not overwrite messages
-    // TODO: only for message window
-    msg_didout = TRUE;
-    if (msg_col == 0)
-	msg_col = 1;
+    ew_msg_didout = TRUE;
+    ew_msg_col = msg_col == 0 ? 1 : msg_col;
+    msg_didout = save_msg_didout;
+    msg_col = save_msg_col;
 }
 #endif
 
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    551,
+/**/
     550,
 /**/
     549,