patch 9.1.1155: Mode message not cleared after :silent message

Commit: 
https://github.com/vim/vim/commit/fce1fa5b618458f6f10028faadc9a9ddc227fe76
Author: zeertzjq <zeert...@outlook.com>
Date:   Thu Feb 27 19:19:36 2025 +0100

    patch 9.1.1155: Mode message not cleared after :silent message
    
    Problem:  Mode message not cleared after :silent message
              (after 9.0.1634).
    Solution: Don't reset mode_displayed when the message is empty.
              (zeertzjq)
    
    fixes: neovim/neovim#32641
    closes: #16744
    
    Signed-off-by: zeertzjq <zeert...@outlook.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/message.c b/src/message.c
index 24984123b..99fe675d8 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1747,7 +1747,7 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
 
     // When drawing over the command line no need to clear it later or remove
     // the mode message.
-    if (msg_row >= cmdline_row && msg_col == 0)
+    if (msg_silent == 0 && len > 0 && msg_row >= cmdline_row && msg_col == 0)
     {
        clear_cmdline = FALSE;
        mode_displayed = FALSE;
diff --git a/src/testdir/dumps/Test_mode_cleared_after_silent_message_1.dump 
b/src/testdir/dumps/Test_mode_cleared_after_silent_message_1.dump
new file mode 100644
index 000000000..5a704d60e
--- /dev/null
+++ b/src/testdir/dumps/Test_mode_cleared_after_silent_message_1.dump
@@ -0,0 +1,10 @@
+>f+0&#ffffff0|o@1|b|a|r| @68
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@34|1| @8|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/dumps/Test_mode_cleared_after_silent_message_2.dump 
b/src/testdir/dumps/Test_mode_cleared_after_silent_message_2.dump
new file mode 100644
index 000000000..90038452c
--- /dev/null
+++ b/src/testdir/dumps/Test_mode_cleared_after_silent_message_2.dump
@@ -0,0 +1,10 @@
+>o+0&#ffffff0@1|b|a|r| @69
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index c566bbc4d..87b1131c5 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -382,6 +382,29 @@ func Test_message_not_cleared_after_mode()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_mode_cleared_after_silent_message()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+    edit XsilentMessageMode.txt
+    call setline(1, 'foobar')
+    autocmd TextChanged * silent update
+  END
+  call writefile(lines, 'XsilentMessageMode', 'D')
+  let buf = RunVimInTerminal('-S XsilentMessageMode', {'rows': 10})
+
+  call term_sendkeys(buf, 'v')
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_mode_cleared_after_silent_message_1', {})
+
+  call term_sendkeys(buf, 'd')
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_mode_cleared_after_silent_message_2', {})
+
+  call StopVimInTerminal(buf)
+  call delete('XsilentMessageMode.txt')
+endfunc
+
 " Test verbose message before echo command
 func Test_echo_verbose_system()
   CheckRunVimInTerminal
diff --git a/src/version.c b/src/version.c
index 6e668fc6a..9c3f70b8b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1155,
 /**/
     1154,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tnie5-00Gbcn-TT%40256bit.org.

Raspunde prin e-mail lui