mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0002: :stopinsert changes the message position
Problem: :stopinsert changes the message position.
Solution: Save and restore msg_col and msg_row in clearmode(). (Jason
Franklin)
2abad54ced
This commit is contained in:
parent
233a173226
commit
5f41ca4013
@ -6595,6 +6595,9 @@ void unshowmode(bool force)
|
|||||||
// Clear the mode message.
|
// Clear the mode message.
|
||||||
void clearmode(void)
|
void clearmode(void)
|
||||||
{
|
{
|
||||||
|
const int save_msg_row = msg_row;
|
||||||
|
const int save_msg_col = msg_col;
|
||||||
|
|
||||||
msg_ext_ui_flush();
|
msg_ext_ui_flush();
|
||||||
msg_pos_mode();
|
msg_pos_mode();
|
||||||
if (reg_recording != 0) {
|
if (reg_recording != 0) {
|
||||||
@ -6602,6 +6605,9 @@ void clearmode(void)
|
|||||||
}
|
}
|
||||||
msg_clr_eos();
|
msg_clr_eos();
|
||||||
msg_ext_flush_showmode();
|
msg_ext_flush_showmode();
|
||||||
|
|
||||||
|
msg_col = save_msg_col;
|
||||||
|
msg_row = save_msg_row;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void recording_mode(int attr)
|
static void recording_mode(int attr)
|
||||||
|
@ -39,6 +39,27 @@ function Test_messages()
|
|||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Patch 7.4.1696 defined the "clearmode()" command for clearing the mode
|
||||||
|
" indicator (e.g., "-- INSERT --") when ":stopinsert" is invoked. Message
|
||||||
|
" output could then be disturbed when 'cmdheight' was greater than one.
|
||||||
|
" This test ensures that the bugfix for this issue remains in place.
|
||||||
|
function! Test_stopinsert_does_not_break_message_output()
|
||||||
|
set cmdheight=2
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
stopinsert | echo 'test echo'
|
||||||
|
call assert_equal(116, screenchar(&lines - 1, 1))
|
||||||
|
call assert_equal(32, screenchar(&lines, 1))
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
stopinsert | echomsg 'test echomsg'
|
||||||
|
call assert_equal(116, screenchar(&lines - 1, 1))
|
||||||
|
call assert_equal(32, screenchar(&lines, 1))
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
set cmdheight&
|
||||||
|
endfunction
|
||||||
|
|
||||||
func Test_message_completion()
|
func Test_message_completion()
|
||||||
call feedkeys(":message \<C-A>\<C-B>\"\<CR>", 'tx')
|
call feedkeys(":message \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
call assert_equal('"message clear', @:)
|
call assert_equal('"message clear', @:)
|
||||||
|
Loading…
Reference in New Issue
Block a user