annotate src/testdir/test103.in @ 11545:1780e6fecb30 v8.0.0655

patch 8.0.0655: not easy to make sure a function does not exist commit https://github.com/vim/vim/commit/d6abcd154cdc6a8dd4b7c6ccad37617ea8a1b4aa Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 22 19:15:24 2017 +0200 patch 8.0.0655: not easy to make sure a function does not exist Problem: Not easy to make sure a function does not exist. Solution: Add ! as an optional argument to :delfunc.
author Christian Brabandt <cb@256bit.org>
date Thu, 22 Jun 2017 19:30:04 +0200
parents ae45d497868f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5498
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 Test for visual mode not being reset causing E315 error.
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 STARTTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 :so small.vim
11091
ae45d497868f patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents: 5498
diff changeset
4 :set belloff=all
5498
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :enew
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 :let g:msg="Everything's fine."
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :function! TriggerTheProblem()
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 : " At this point there is no visual selection because :call reset it.
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 : " Let's restore the selection:
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 : normal gv
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 : '<,'>del _
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 : try
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 : exe "normal \<Esc>"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 : catch /^Vim\%((\a\+)\)\=:E315/
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 : echom 'Snap! E315 error!'
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 : let g:msg='Snap! E315 error!'
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 : endtry
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :endfunction
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :enew
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 :setl buftype=nofile
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :call append(line('$'), 'Delete this line.')
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 :"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 :"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 :" NOTE: this has to be done by a call to a function because executing :del the
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 :" ex-way will require the colon operator which resets the visual mode thus
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 :" preventing the problem:
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 :"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 GV:call TriggerTheProblem()
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 :%del _
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 :call append(line('$'), g:msg)
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 :w! test.out
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 :brewind
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 ENDTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 STARTTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 :qa!
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 ENDTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38