mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-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.
da51ad51bf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1562,7 +1562,7 @@ int msg_outtrans_len_attr(const char *msgstr, int len, int attr)
|
|||||||
|
|
||||||
// When drawing over the command line no need to clear it later or remove
|
// When drawing over the command line no need to clear it later or remove
|
||||||
// the mode message.
|
// the mode message.
|
||||||
if (msg_row == cmdline_row && msg_col == 0) {
|
if (msg_row >= cmdline_row && msg_col == 0) {
|
||||||
clear_cmdline = false;
|
clear_cmdline = false;
|
||||||
mode_displayed = false;
|
mode_displayed = false;
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,7 @@ describe('messages', function()
|
|||||||
screen = Screen.new(60, 10)
|
screen = Screen.new(60, 10)
|
||||||
screen:set_default_attr_ids({
|
screen:set_default_attr_ids({
|
||||||
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||||
|
[1] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg
|
||||||
})
|
})
|
||||||
screen:attach()
|
screen:attach()
|
||||||
exec([[
|
exec([[
|
||||||
@@ -64,13 +65,13 @@ describe('messages', function()
|
|||||||
endfunction
|
endfunction
|
||||||
set showmode
|
set showmode
|
||||||
set cmdheight=1
|
set cmdheight=1
|
||||||
call setline(1, ['one', 'two', 'three'])
|
call setline(1, ['one', 'NoSuchFile', 'three'])
|
||||||
]])
|
]])
|
||||||
|
|
||||||
feed('gx')
|
feed('gx')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^one |
|
^one |
|
||||||
two |
|
NoSuchFile |
|
||||||
three |
|
three |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
@@ -85,7 +86,7 @@ describe('messages', function()
|
|||||||
feed('vEgx')
|
feed('vEgx')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^one |
|
^one |
|
||||||
two |
|
NoSuchFile |
|
||||||
three |
|
three |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
@@ -95,6 +96,22 @@ describe('messages', function()
|
|||||||
{0:~ }|
|
{0:~ }|
|
||||||
from DebugSilent visual |
|
from DebugSilent visual |
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
-- removing the mode message used to also clear the error message
|
||||||
|
command('set cmdheight=2')
|
||||||
|
feed('2GvEgf')
|
||||||
|
screen:expect([[
|
||||||
|
one |
|
||||||
|
NoSuchFil^e |
|
||||||
|
three |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
from DebugSilent visual |
|
||||||
|
{1:E447: Can't find file "NoSuchFile" in path} |
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('more prompt', function()
|
describe('more prompt', function()
|
||||||
|
@@ -352,7 +352,8 @@ func Test_message_not_cleared_after_mode()
|
|||||||
endfunction
|
endfunction
|
||||||
set showmode
|
set showmode
|
||||||
set cmdheight=1
|
set cmdheight=1
|
||||||
call setline(1, ['one', 'two', 'three'])
|
call test_settime(1)
|
||||||
|
call setline(1, ['one', 'NoSuchFile', 'three'])
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XmessageMode', 'D')
|
call writefile(lines, 'XmessageMode', 'D')
|
||||||
let buf = RunVimInTerminal('-S XmessageMode', {'rows': 10})
|
let buf = RunVimInTerminal('-S XmessageMode', {'rows': 10})
|
||||||
@@ -366,6 +367,12 @@ func Test_message_not_cleared_after_mode()
|
|||||||
call TermWait(buf)
|
call TermWait(buf)
|
||||||
call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_2', {})
|
call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_2', {})
|
||||||
|
|
||||||
|
" removing the mode message used to also clear the error message
|
||||||
|
call term_sendkeys(buf, ":set cmdheight=2\<CR>")
|
||||||
|
call term_sendkeys(buf, '2GvEgf')
|
||||||
|
call TermWait(buf)
|
||||||
|
call VerifyScreenDump(buf, 'Test_message_not_cleared_after_mode_3', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user