annotate src/testdir/test103.in @ 5498:79a8bac614c0 v7.4.098

updated for version 7.4.098 Problem: When using ":'<,'>del" errors may be given for the visual line numbers being out of range. Solution: Reset Visual mode in ":del". (Lech Lorens)
author Bram Moolenaar <bram@vim.org>
date Thu, 21 Nov 2013 14:21:40 +0100
parents
children ae45d497868f
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
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 :enew
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :let g:msg="Everything's fine."
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 :function! TriggerTheProblem()
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 : " 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
8 : " Let's restore the selection:
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 : normal gv
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 : '<,'>del _
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 : try
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 : exe "normal \<Esc>"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 : catch /^Vim\%((\a\+)\)\=:E315/
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 : echom 'Snap! E315 error!'
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 : let g:msg='Snap! E315 error!'
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 : endtry
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 :endfunction
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :enew
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :setl buftype=nofile
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 :call append(line('$'), 'Delete this line.')
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :"
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 :" 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
24 :" 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
25 :" preventing the problem:
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 :"
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 GV:call TriggerTheProblem()
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 :%del _
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 :call append(line('$'), g:msg)
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 :w! test.out
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 :brewind
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 ENDTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 STARTTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 :qa!
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 ENDTEST
79a8bac614c0 updated for version 7.4.098
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37