annotate src/testdir/test45.in @ 8952:9b04f9e8d1d4 v7.4.1761

commit https://github.com/vim/vim/commit/8ed43916dbea4ccedcc84d271e292abbf658b9c5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 21 08:56:12 2016 +0200 patch 7.4.1761 Problem: Coverity complains about ignoring return value. Solution: Add "(void)" to get rid of the warning.
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Apr 2016 09:00:08 +0200
parents b85fcd9b858d
children ae45d497868f
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
1977
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
31 :syn region Hup start="dd" end="ii" fold contains=Fd1,Fd2,Fd3
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
32 :syn region Fd1 start="ee" end="ff" fold contained
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
33 :syn region Fd2 start="gg" end="hh" fold contained
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
34 :syn region Fd3 start="commentstart" end="commentend" fold contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 Gzk:call append("$", "folding " . getline("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 k:call append("$", getline("."))
1977
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
37 jAcommentstart Acommentend:set fdl=1
f018c759e4ed updated for version 7.2-274
vimboss
parents: 1405
diff changeset
38 3j:call append("$", getline("."))
2086
c11845a465ae updated for version 7.2.370
Bram Moolenaar <bram@zimbu.org>
parents: 1977
diff changeset
39 :set fdl=0
c11845a465ae updated for version 7.2.370
Bram Moolenaar <bram@zimbu.org>
parents: 1977
diff changeset
40 zO j:call append("$", getline("."))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 :" test expression folding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 :fun Flvl()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 let l = getline(v:lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if l =~ "bb$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 return 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 elseif l =~ "gg$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 return "s1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 elseif l =~ "ii$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 return ">2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 elseif l =~ "kk$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 return "0"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 return "="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 :set fdm=expr fde=Flvl()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 /bb$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 :call append("$", "expr " . foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 /hh$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 /ii$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 /kk$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 :call append("$", foldlevel("."))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 :/^last/+1,$w! test.out
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 7
diff changeset
65 :delfun Flvl
6755
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
66 :new
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
67 iTest fdm=indent and :move bug END
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
68 line2
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
69 Test fdm=indent START
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
70 line3
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
71 line4
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
72 :set fdm=indent
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
73 :1m1
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
74 2jzc:m0
b85fcd9b858d patch 7.4.700
Bram Moolenaar <bram@vim.org>
parents: 2086
diff changeset
75 :%w >> test.out
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 :qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 1 aa
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 2 bb
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 3 cc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 4 dd {{{
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 5 ee {{{ }}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 6 ff }}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 7 gg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 8 hh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 9 ii
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 a jj
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 b kk
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 last