mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.0.1634: message is cleared when removing mode message
Problem: Message is cleared when removing mode message (Gary Johnson).
Solution: Do not clear the command line after displaying a message.
800cdbb7ca
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1560,6 +1560,13 @@ int msg_outtrans_len_attr(const char *msgstr, int len, int attr)
|
|||||||
attr &= ~MSG_HIST;
|
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
|
// If the string starts with a composing character first draw a space on
|
||||||
// which the composing char can be drawn.
|
// which the composing char can be drawn.
|
||||||
if (utf_iscomposing(utf_ptr2char(msgstr))) {
|
if (utf_iscomposing(utf_ptr2char(msgstr))) {
|
||||||
|
@@ -49,6 +49,54 @@ describe('messages', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- oldtest: Test_message_not_cleared_after_mode()
|
||||||
|
it('clearing mode does not remove message', function()
|
||||||
|
screen = Screen.new(60, 10)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||||
|
})
|
||||||
|
screen:attach()
|
||||||
|
exec([[
|
||||||
|
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'])
|
||||||
|
]])
|
||||||
|
|
||||||
|
feed('gx')
|
||||||
|
screen:expect([[
|
||||||
|
^one |
|
||||||
|
two |
|
||||||
|
three |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
from DebugSilent normal |
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- removing the mode message used to also clear the intended message
|
||||||
|
feed('vEgx')
|
||||||
|
screen:expect([[
|
||||||
|
^one |
|
||||||
|
two |
|
||||||
|
three |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
from DebugSilent visual |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
describe('more prompt', function()
|
describe('more prompt', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
command('set more')
|
command('set more')
|
||||||
|
@@ -2475,7 +2475,7 @@ describe("TUI as a client", function()
|
|||||||
|
|
||||||
-- grid smaller than containing terminal window is cleared properly
|
-- grid smaller than containing terminal window is cleared properly
|
||||||
feed_data(":call setline(1,['a'->repeat(&columns)]->repeat(&lines))\n")
|
feed_data(":call setline(1,['a'->repeat(&columns)]->repeat(&lines))\n")
|
||||||
feed_data("0:set lines=2\n")
|
feed_data("0:set lines=3\n")
|
||||||
screen_server:expect{grid=[[
|
screen_server:expect{grid=[[
|
||||||
{1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
{1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||||
{5:[No Name] [+] }|
|
{5:[No Name] [+] }|
|
||||||
|
@@ -341,6 +341,34 @@ func Test_message_more_scrollback()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
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
|
" Test verbose message before echo command
|
||||||
func Test_echo_verbose_system()
|
func Test_echo_verbose_system()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
|
Reference in New Issue
Block a user