mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem: Mode is not cleared when leaving Insert mode.
Solution: Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270)
abc7c7fc5a
This commit is contained in:
parent
0519a75f6e
commit
4afddb8f57
@ -7803,7 +7803,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove)
|
|||||||
// Otherwise remove the mode message.
|
// Otherwise remove the mode message.
|
||||||
if (reg_recording != 0 || restart_edit != NUL) {
|
if (reg_recording != 0 || restart_edit != NUL) {
|
||||||
showmode();
|
showmode();
|
||||||
} else if (p_smd && !skip_showmode()) {
|
} else if (p_smd && (got_int || !skip_showmode())) {
|
||||||
MSG("");
|
MSG("");
|
||||||
}
|
}
|
||||||
// Exit Insert mode
|
// Exit Insert mode
|
||||||
|
@ -19,7 +19,7 @@ func Test_setbufline_getbufline()
|
|||||||
let b = bufnr('%')
|
let b = bufnr('%')
|
||||||
wincmd w
|
wincmd w
|
||||||
call assert_equal(1, setbufline(b, 5, ['x']))
|
call assert_equal(1, setbufline(b, 5, ['x']))
|
||||||
call assert_equal(1, setbufline(1234, 1, ['x']))
|
call assert_equal(1, setbufline(bufnr('$') + 1, 1, ['x']))
|
||||||
call assert_equal(0, setbufline(b, 4, ['d', 'e']))
|
call assert_equal(0, setbufline(b, 4, ['d', 'e']))
|
||||||
call assert_equal(['c'], getbufline(b, 3))
|
call assert_equal(['c'], getbufline(b, 3))
|
||||||
call assert_equal(['d'], getbufline(b, 4))
|
call assert_equal(['d'], getbufline(b, 4))
|
||||||
|
@ -89,6 +89,37 @@ func Test_echoerr()
|
|||||||
call test_ignore_error('RESET')
|
call test_ignore_error('RESET')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_mode_message_at_leaving_insert_by_ctrl_c()
|
||||||
|
if !has('terminal') || has('gui_running')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Set custom statusline built by user-defined function.
|
||||||
|
let testfile = 'Xtest.vim'
|
||||||
|
call writefile([
|
||||||
|
\ 'func StatusLine() abort',
|
||||||
|
\ ' return ""',
|
||||||
|
\ 'endfunc',
|
||||||
|
\ 'set statusline=%!StatusLine()',
|
||||||
|
\ 'set laststatus=2',
|
||||||
|
\ ], testfile)
|
||||||
|
|
||||||
|
let rows = 10
|
||||||
|
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
|
||||||
|
call term_wait(buf, 200)
|
||||||
|
call assert_equal('run', job_status(term_getjob(buf)))
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "i")
|
||||||
|
call WaitForAssert({-> assert_match('^-- INSERT --\s*$', term_getline(buf, rows))})
|
||||||
|
call term_sendkeys(buf, "\<C-C>")
|
||||||
|
call WaitForAssert({-> assert_match('^\s*$', term_getline(buf, rows))})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":qall!\<CR>")
|
||||||
|
call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
|
||||||
|
exe buf . 'bwipe!'
|
||||||
|
call delete(testfile)
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_echospace()
|
func Test_echospace()
|
||||||
set noruler noshowcmd laststatus=1
|
set noruler noshowcmd laststatus=1
|
||||||
call assert_equal(&columns - 1, v:echospace)
|
call assert_equal(&columns - 1, v:echospace)
|
||||||
|
Loading…
Reference in New Issue
Block a user