diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-13 01:50:58 -0500 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-26 02:34:13 -0500 |
| commit | 44bb7147e40743d9a70ee3a2663a7a7dacec7b13 (patch) | |
| tree | 5f8913cf05a046d2ec23840915d8bb1884db768f /src/nvim/testdir | |
| parent | 4afddb8f571d9e61eab60596c59a27452e9bc839 (diff) | |
| download | rneovim-44bb7147e40743d9a70ee3a2663a7a7dacec7b13.tar.gz rneovim-44bb7147e40743d9a70ee3a2663a7a7dacec7b13.tar.bz2 rneovim-44bb7147e40743d9a70ee3a2663a7a7dacec7b13.zip | |
vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem: Mode is not cleared when leaving Insert mode with mapped Esc.
Solution: Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
https://github.com/vim/vim/commit/4c25bd785aa8b565bf973cbba12ed36b76daaa4f
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_messages.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim index 4051288c7f..d0a8f342c9 100644 --- a/src/nvim/testdir/test_messages.vim +++ b/src/nvim/testdir/test_messages.vim @@ -120,6 +120,34 @@ func Test_mode_message_at_leaving_insert_by_ctrl_c() call delete(testfile) endfunc +func Test_mode_message_at_leaving_insert_with_esc_mapped() + if !has('terminal') || has('gui_running') + return + endif + + " Set custom statusline built by user-defined function. + let testfile = 'Xtest.vim' + call writefile([ + \ 'set laststatus=2', + \ 'inoremap <Esc> <Esc>00', + \ ], 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, "\<Esc>") + 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() set noruler noshowcmd laststatus=1 call assert_equal(&columns - 1, v:echospace) |