diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-06-26 15:39:09 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-15 17:58:35 +0800 |
| commit | 93ba82183122b6b6e3d388d0e0fad4a538052803 (patch) | |
| tree | 7020800bddbd1ec8c5e36a1319eeee1c2892c5e0 /src/nvim/testdir | |
| parent | 53b0688ac0cad5db4840bbed1d7e5ccac3a1ee42 (diff) | |
| download | rneovim-93ba82183122b6b6e3d388d0e0fad4a538052803.tar.gz rneovim-93ba82183122b6b6e3d388d0e0fad4a538052803.tar.bz2 rneovim-93ba82183122b6b6e3d388d0e0fad4a538052803.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 19d7d23cca..e181641a3b 100644 --- a/src/nvim/testdir/test_messages.vim +++ b/src/nvim/testdir/test_messages.vim @@ -126,6 +126,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) |