patch 8.2.5109: mode not updated after CTRL-O CTRL-C in Insert mode
Problem: Mode not updated after CTRL-O CTRL-C in Insert mode. Solution: Set redraw_mode and use it. (closes #10581)
This commit is contained in:
@ -1419,7 +1419,7 @@ main_loop(
|
|||||||
update_screen(0);
|
update_screen(0);
|
||||||
mch_enable_flush();
|
mch_enable_flush();
|
||||||
}
|
}
|
||||||
else if (redraw_cmdline || clear_cmdline)
|
else if (redraw_cmdline || clear_cmdline || redraw_mode)
|
||||||
showmode();
|
showmode();
|
||||||
redraw_statuslines();
|
redraw_statuslines();
|
||||||
if (need_maketitle)
|
if (need_maketitle)
|
||||||
|
|||||||
@ -6788,6 +6788,9 @@ nv_esc(cmdarg_T *cap)
|
|||||||
msg(_("Type :qa and press <Enter> to exit Vim"));
|
msg(_("Type :qa and press <Enter> to exit Vim"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restart_edit != 0)
|
||||||
|
redraw_mode = TRUE; // remove "-- (insert) --"
|
||||||
|
|
||||||
// Don't reset "restart_edit" when 'insertmode' is set, it won't be
|
// Don't reset "restart_edit" when 'insertmode' is set, it won't be
|
||||||
// set again below when halfway a mapping.
|
// set again below when halfway a mapping.
|
||||||
if (!p_im)
|
if (!p_im)
|
||||||
|
|||||||
5
src/testdir/dumps/Test_mode_updated_1.dump
Normal file
5
src/testdir/dumps/Test_mode_updated_1.dump
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
> +0&#ffffff0@74
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
| +0#0000000&@56|0|,|0|-|1| @8|A|l@1|
|
||||||
@ -4,6 +4,7 @@ source shared.vim
|
|||||||
source check.vim
|
source check.vim
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
import './vim9.vim' as v9
|
import './vim9.vim' as v9
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
func Setup_NewWindow()
|
func Setup_NewWindow()
|
||||||
10new
|
10new
|
||||||
@ -2458,9 +2459,9 @@ func Test_normal33_g_cmd2()
|
|||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
call assert_fails(':norm! g;', 'E662:')
|
call assert_fails(':norm! g;', 'E662:')
|
||||||
call assert_fails(':norm! g,', 'E663:')
|
call assert_fails(':norm! g,', 'E663:')
|
||||||
let &ul=&ul
|
let &ul = &ul
|
||||||
call append('$', ['a', 'b', 'c', 'd'])
|
call append('$', ['a', 'b', 'c', 'd'])
|
||||||
let &ul=&ul
|
let &ul = &ul
|
||||||
call append('$', ['Z', 'Y', 'X', 'W'])
|
call append('$', ['Z', 'Y', 'X', 'W'])
|
||||||
let a = execute(':changes')
|
let a = execute(':changes')
|
||||||
call assert_match('2\s\+0\s\+2', a)
|
call assert_match('2\s\+0\s\+2', a)
|
||||||
@ -3266,6 +3267,20 @@ func Test_message_when_using_ctrl_c()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_mode_updated_after_ctrl_c()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let buf = RunVimInTerminal('', {'rows': 5})
|
||||||
|
call term_sendkeys(buf, "i")
|
||||||
|
call term_sendkeys(buf, "\<C-O>")
|
||||||
|
" wait a moment so that the "-- (insert) --" message is displayed
|
||||||
|
call TermWait(buf, 50)
|
||||||
|
call term_sendkeys(buf, "\<C-C>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_mode_updated_1', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for '[m', ']m', '[M' and ']M'
|
" Test for '[m', ']m', '[M' and ']M'
|
||||||
" Jumping to beginning and end of methods in Java-like languages
|
" Jumping to beginning and end of methods in Java-like languages
|
||||||
func Test_java_motion()
|
func Test_java_motion()
|
||||||
|
|||||||
@ -734,6 +734,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
5109,
|
||||||
/**/
|
/**/
|
||||||
5108,
|
5108,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user