blob: 7c7591e3b9f89cd302661b6b06f86d02321526fa [file] [log] [blame]
Bram Moolenaard07c6e12013-11-21 14:21:40 +01001Test for visual mode not being reset causing E315 error.
2STARTTEST
3:so small.vim
4:enew
5:let g:msg="Everything's fine."
6:function! TriggerTheProblem()
7: " At this point there is no visual selection because :call reset it.
8: " Let's restore the selection:
9: normal gv
10: '<,'>del _
11: try
12: exe "normal \<Esc>"
13: catch /^Vim\%((\a\+)\)\=:E315/
14: echom 'Snap! E315 error!'
15: let g:msg='Snap! E315 error!'
16: endtry
17:endfunction
18:enew
19:setl buftype=nofile
20:call append(line('$'), 'Delete this line.')
21:"
22:"
23:" NOTE: this has to be done by a call to a function because executing :del the
24:" ex-way will require the colon operator which resets the visual mode thus
25:" preventing the problem:
26:"
27GV:call TriggerTheProblem()
28:%del _
29:call append(line('$'), g:msg)
30:w! test.out
31:brewind
32ENDTEST
33
34STARTTEST
35:qa!
36ENDTEST
37