6675
|
1 Tests for text-objects vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
|
5 :if !has('textobjects') | e! test.ok | wq! test.out | endif
|
6742
|
6 :set nocp viminfo+=nviminfo
|
6675
|
7 :"
|
|
8 :function SelectionOut(data)
|
|
9 : new
|
|
10 : call setline(1, a:data)
|
|
11 : call setreg('"', '')
|
|
12 : normal! ggfrmavi)y
|
|
13 : $put =getreg('\"')
|
|
14 : call setreg('"', '')
|
|
15 : normal! `afbmavi)y
|
|
16 : $put =getreg('\"')
|
|
17 : call setreg('"', '')
|
|
18 : normal! `afgmavi)y
|
|
19 : $put =getreg('\"')
|
|
20 : %yank a
|
|
21 : q!
|
|
22 : $put =getreg('a')
|
|
23 :endfunction
|
|
24 :"
|
|
25 :$put ='# Test for vi) without cpo-M'
|
|
26 :set cpo-=M
|
|
27 :call SelectionOut('(red \(blue) green)')
|
|
28 :"
|
|
29 :$put ='# Test for vi) with cpo-M #1'
|
|
30 :set cpo+=M
|
|
31 :call SelectionOut('(red \(blue) green)')
|
|
32 :"
|
|
33 :$put ='# Test for vi) with cpo-M #2'
|
|
34 :set cpo+=M
|
|
35 :call SelectionOut('(red (blue\) green)')
|
|
36 :/^Results/,$w test.out
|
|
37 :qa!
|
|
38 ENDTEST
|
|
39
|
|
40 Results of text-objects
|