Patch 9.0.1634
Problem:    Message is cleared when removing mode message (Gary Johnson).
Solution:   Do not clear the command line after displaying a message.
Files:      src/message.c, src/testdir/test_messages.vim,
            src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump,
            src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump


*** ../vim-9.0.1633/src/message.c       2023-05-24 21:02:20.481162129 +0100
--- src/message.c       2023-06-15 16:24:41.185486445 +0100
***************
*** 1641,1646 ****
--- 1641,1654 ----
        attr &= ~MSG_HIST;
      }
  
+     // 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)
+     {
+       clear_cmdline = FALSE;
+       mode_displayed = FALSE;
+     }
+ 
      // If the string starts with a composing character first draw a space on
      // which the composing char can be drawn.
      if (enc_utf8 && utf_iscomposing(utf_ptr2char(msgstr)))
*** ../vim-9.0.1633/src/testdir/test_messages.vim       2022-11-27 
14:39:27.885337780 +0000
--- src/testdir/test_messages.vim       2023-06-15 16:32:44.721389719 +0100
***************
*** 336,341 ****
--- 336,369 ----
    call StopVimInTerminal(buf)
  endfunc
  
+ func Test_message_not_cleared_after_mode()
+   CheckRunVimInTerminal
+ 
+   let lines =<< trim END
+       nmap <silent> gx :call DebugSilent('normal')<CR>
+       vmap <silent> gx :call DebugSilent('visual')<CR>
+       function DebugSilent(arg)
+           echomsg "from DebugSilent" a:arg
+       endfunction
+       set showmode
+       set cmdheight=1
+       call setline(1, ['one', 'two', 'three'])
+   END
+   call writefile(lines, 'XmessageMode', 'D')
+   let buf = RunVimInTerminal('-S XmessageMode', {'rows': 10})
+ 
+   call term_sendkeys(buf, 'gx')
+   call TermWait(buf)
+   call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_1', {})
+ 
+   " removing the mode message used to also clear the intended message
+   call term_sendkeys(buf, 'vEgx')
+   call TermWait(buf)
+   call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_2', {})
+ 
+   call StopVimInTerminal(buf)
+ endfunc
+ 
  " Test verbose message before echo command
  func Test_echo_verbose_system()
    CheckRunVimInTerminal
*** 
../vim-9.0.1633/src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump    
    2023-06-15 16:39:05.513763546 +0100
--- src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump        
2023-06-15 16:33:02.669381594 +0100
***************
*** 0 ****
--- 1,10 ----
+ >o+0&#ffffff0|n|e| @71
+ |t|w|o| @71
+ |t|h|r|e@1| @69
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |f+0#0000000&|r|o|m| |D|e|b|u|g|S|i|l|e|n|t| |n|o|r|m|a|l| @33|1|,|1| 
@10|A|l@1| 
*** 
../vim-9.0.1633/src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump    
    2023-06-15 16:39:05.521763592 +0100
--- src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump        
2023-06-15 16:33:03.925381017 +0100
***************
*** 0 ****
--- 1,10 ----
+ >o+0&#ffffff0|n|e| @71
+ |t|w|o| @71
+ |t|h|r|e@1| @69
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |f+0#0000000&|r|o|m| |D|e|b|u|g|S|i|l|e|n|t| |v|i|s|u|a|l| @33|1|,|1| 
@10|A|l@1| 
*** ../vim-9.0.1633/src/version.c       2023-06-15 10:41:15.638227833 +0100
--- src/version.c       2023-06-15 16:33:55.745356239 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1634,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
177. You log off of your system because it's time to go to work.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230615160125.06CA91C0D56%40moolenaar.net.

Raspunde prin e-mail lui