comparison src/testdir/test_messages.vim @ 16374:57c37c17ff9d v8.1.1192

patch 8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc commit https://github.com/vim/vim/commit/4c25bd785aa8b565bf973cbba12ed36b76daaa4f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 20 23:38:07 2019 +0200 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 https://github.com/vim/vim/issues/4269)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Apr 2019 23:45:04 +0200
parents a3b5cbd2effe
children 6990c1160ea5
comparison
equal deleted inserted replaced
16373:e400a838865d 16374:57c37c17ff9d
123 call term_sendkeys(buf, ":qall!\<CR>") 123 call term_sendkeys(buf, ":qall!\<CR>")
124 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))}) 124 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
125 exe buf . 'bwipe!' 125 exe buf . 'bwipe!'
126 call delete(testfile) 126 call delete(testfile)
127 endfunc 127 endfunc
128
129 func Test_mode_message_at_leaving_insert_with_esc_mapped()
130 if !has('terminal') || has('gui_running')
131 return
132 endif
133
134 " Set custom statusline built by user-defined function.
135 let testfile = 'Xtest.vim'
136 call writefile([
137 \ 'set laststatus=2',
138 \ 'inoremap <Esc> <Esc>00',
139 \ ], testfile)
140
141 let rows = 10
142 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
143 call term_wait(buf, 200)
144 call assert_equal('run', job_status(term_getjob(buf)))
145
146 call term_sendkeys(buf, "i")
147 call WaitForAssert({-> assert_match('^-- INSERT --\s*$', term_getline(buf, rows))})
148 call term_sendkeys(buf, "\<Esc>")
149 call WaitForAssert({-> assert_match('^\s*$', term_getline(buf, rows))})
150
151 call term_sendkeys(buf, ":qall!\<CR>")
152 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
153 exe buf . 'bwipe!'
154 call delete(testfile)
155 endfunc