Skip to content

Commit da51ad5

Browse files
committed
patch 9.0.1635: error message is cleared when removing mode message
Problem: Error message is cleared when removing mode message. Solution: Also reset flags when the message is further down.
1 parent 800cdbb commit da51ad5

6 files changed

Lines changed: 23 additions & 4 deletions

src/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
16431643

16441644
// When drawing over the command line no need to clear it later or remove
16451645
// the mode message.
1646-
if (msg_row == cmdline_row && msg_col == 0)
1646+
if (msg_row >= cmdline_row && msg_col == 0)
16471647
{
16481648
clear_cmdline = FALSE;
16491649
mode_displayed = FALSE;

src/testdir/dumps/Test_message_not_cleared_after_mode_1.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>o+0&#ffffff0|n|e| @71
2-
|t|w|o| @71
2+
|N|o|S|u|c|h|F|i|l|e| @64
33
|t|h|r|e@1| @69
44
|~+0#4040ff13&| @73
55
|~| @73

src/testdir/dumps/Test_message_not_cleared_after_mode_2.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>o+0&#ffffff0|n|e| @71
2-
|t|w|o| @71
2+
|N|o|S|u|c|h|F|i|l|e| @64
33
|t|h|r|e@1| @69
44
|~+0#4040ff13&| @73
55
|~| @73
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
|o+0&#ffffff0|n|e| @71
2+
|N|o|S|u|c|h|F|i|l>e| @64
3+
|t|h|r|e@1| @69
4+
|~+0#4040ff13&| @73
5+
|~| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
| +0#0000000&@74
10+
|E+0#ffffff16#e000002|4@1|7|:| |C|a|n|'|t| |f|i|n|d| |f|i|l|e| |"|N|o|S|u|c|h|F|i|l|e|"| |i|n| |p|a|t|h| +0#0000000#ffffff0@14|2|,|1|0| @9|A|l@1|

src/testdir/test_messages.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ func Test_message_not_cleared_after_mode()
347347
endfunction
348348
set showmode
349349
set cmdheight=1
350-
call setline(1, ['one', 'two', 'three'])
350+
call test_settime(1)
351+
call setline(1, ['one', 'NoSuchFile', 'three'])
351352
END
352353
call writefile(lines, 'XmessageMode', 'D')
353354
let buf = RunVimInTerminal('-S XmessageMode', {'rows': 10})
@@ -361,6 +362,12 @@ func Test_message_not_cleared_after_mode()
361362
call TermWait(buf)
362363
call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_2', {})
363364

365+
" removing the mode message used to also clear the error message
366+
call term_sendkeys(buf, ":set cmdheight=2\<CR>")
367+
call term_sendkeys(buf, '2GvEgf')
368+
call TermWait(buf)
369+
call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_3', {})
370+
364371
call StopVimInTerminal(buf)
365372
endfunc
366373

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1635,
698700
/**/
699701
1634,
700702
/**/

0 commit comments

Comments
 (0)