annotate src/testdir/test45.in @ 1803:684ea86baabb v7.2.101

updated for version 7.2-101
author vimboss
date Wed, 04 Feb 2009 17:35:52 +0000
parents b63792dadc23
children f018c759e4ed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 Tests for folding. vim: set ft=vim :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 :" We also need the +syntax feature here.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 e! test.ok
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 w! test.out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 :" basic test if a fold can be created, opened, moving to the end and closed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 /^1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 zf2j:call append("$", "manual " . getline(foldclosed(".")))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 zo:call append("$", foldclosed("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 ]z:call append("$", getline("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 zc:call append("$", getline(foldclosed(".")))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 :" test folding with markers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 :set fdm=marker fdl=1 fdc=3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 /^5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 :call append("$", "marker " . foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 [z:call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 jo{{ r{jj:call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 kYpj:call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 :" test folding with indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 :set fdm=indent sw=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 /^2 b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 i jI :call append("$", "indent " . foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 k:call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 :" test syntax folding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 :set fdm=syntax fdl=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 :syn region Hup start="dd" end="hh" fold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 Gzk:call append("$", "folding " . getline("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 k:call append("$", getline("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 :" test expression folding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 :fun Flvl()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 let l = getline(v:lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 if l =~ "bb$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 return 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 elseif l =~ "gg$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 return "s1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 elseif l =~ "ii$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 return ">2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 elseif l =~ "kk$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 return "0"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 return "="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 :set fdm=expr fde=Flvl()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 /bb$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 :call append("$", "expr " . foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 /hh$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 /ii$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 /kk$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 :/^last/+1,$w! test.out
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 7
diff changeset
58 :delfun Flvl
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 :qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 1 aa
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 2 bb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 3 cc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 4 dd {{{
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 5 ee {{{ }}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 6 ff }}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 7 gg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 8 hh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 9 ii
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 a jj
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 b kk
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 last