view src/testdir/test103.in @ 10930:126405b39964 v8.0.0354

patch 8.0.0354: test to check that setting termcap key fails sometimes commit https://github.com/vim/vim/commit/1c410400fad79068b16dc4c6c7a023463a0858cf Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 23 15:20:03 2017 +0100 patch 8.0.0354: test to check that setting termcap key fails sometimes Problem: Test to check that setting termcap key fails sometimes. Solution: Check for "t_k1" to exist. (Christian Brabandt, closes https://github.com/vim/vim/issues/1459)
author Christian Brabandt <cb@256bit.org>
date Thu, 23 Feb 2017 15:30:05 +0100
parents 79a8bac614c0
children ae45d497868f
line wrap: on
line source

Test for visual mode not being reset causing E315 error.
STARTTEST
:so small.vim
:enew
:let g:msg="Everything's fine."
:function! TriggerTheProblem()
:	" At this point there is no visual selection because :call reset it.
:	" Let's restore the selection:
:	normal gv
:	'<,'>del _
:	try
:		exe "normal \<Esc>"
:	catch /^Vim\%((\a\+)\)\=:E315/
:		echom 'Snap! E315 error!'
:		let g:msg='Snap! E315 error!'
:	endtry
:endfunction
:enew
:setl buftype=nofile
:call append(line('$'), 'Delete this line.')
:"
:"
:" NOTE: this has to be done by a call to a function because executing :del the
:"       ex-way will require the colon operator which resets the visual mode thus
:"       preventing the problem:
:"
GV:call TriggerTheProblem()
:%del _
:call append(line('$'), g:msg)
:w! test.out
:brewind
ENDTEST

STARTTEST
:qa!
ENDTEST