annotate src/testdir/test_cindent.vim @ 32090:327f8a3e0040 v9.0.1376

patch 9.0.1376: accessing invalid memory with put in Visual block mode Commit: https://github.com/vim/vim/commit/1c73b65229c25e3c1fd8824ba958f7cc4d604f9c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 3 21:11:52 2023 +0000 patch 9.0.1376: accessing invalid memory with put in Visual block mode Problem: Accessing invalid memory with put in Visual block mode. Solution: Adjust the cursor column if needed.
author Bram Moolenaar <Bram@vim.org>
date Fri, 03 Mar 2023 22:15:03 +0100
parents f498ab5c82ea
children 73489b6c4a02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11069
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for cinoptions and cindent
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3 def Test_cino_hash()
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4 # Test that curbuf->b_ind_hash_comment is correctly reset
11069
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 new
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 setlocal cindent cinoptions=#1
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 setlocal cinoptions=
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
8 setline(1, ["#include <iostream>"])
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
9 cursor(1, 1)
11069
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 norm! o#include
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
11 assert_equal(["#include <iostream>", "#include"], getline(1, 2))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
12
11069
814126a34c9d patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
14 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
15
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
16 def Test_cino_extern_c()
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
17 # Test for cino-E
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
18
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
19 var without_ind =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
20 #ifdef __cplusplus
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
21 extern "C" {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
22 #endif
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
23 int func_a(void);
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
24 #ifdef __cplusplus
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
25 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
26 #endif
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16668
diff changeset
27 [CODE]
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
28
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
29 var with_ind =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
30 #ifdef __cplusplus
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
31 extern "C" {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
32 #endif
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
33 int func_a(void);
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
34 #ifdef __cplusplus
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
35 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
36 #endif
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16668
diff changeset
37 [CODE]
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
38 new
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
39 setlocal cindent cinoptions=E0
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
40 setline(1, without_ind)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
41 feedkeys("gg=G", 'tx')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
42 assert_equal(with_ind, getline(1, '$'))
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
43
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
44 setlocal cinoptions=E-s
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
45 setline(1, with_ind)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
46 feedkeys("gg=G", 'tx')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
47 assert_equal(without_ind, getline(1, '$'))
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
48
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
49 setlocal cinoptions=Es
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
50 var tests = [
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
51 \ ['recognized', ['extern "C" {'], "\t\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
52 \ ['recognized', ['extern "C++" {'], "\t\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
53 \ ['recognized', ['extern /* com */ "C"{'], "\t\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
54 \ ['recognized', ['extern"C"{'], "\t\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
55 \ ['recognized', ['extern "C"', '{'], "\t\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
56 \ ['not recognized', ['extern {'], "\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
57 \ ['not recognized', ['extern /*"C"*/{'], "\t;"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
58 \ ['not recognized', ['extern "C" //{'], ";"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
59 \ ['not recognized', ['extern "C" /*{*/'], ";"],
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
60 \ ]
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
61
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
62 for pair in tests
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
63 var lines = pair[1]
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
64 setline(1, lines)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
65 feedkeys(len(lines) .. "Go;", 'tx')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
66 assert_equal(pair[2], getline(len(lines) + 1),
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
67 'Failed for "' .. string(lines) .. '"')
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
68 endfor
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
69
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
70 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
71 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
72
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
73 def Test_cindent_rawstring()
12238
0066a7e178bc patch 8.0.0999: indenting raw C++ strings is wrong
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
74 new
0066a7e178bc patch 8.0.0999: indenting raw C++ strings is wrong
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
75 setl cindent
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
76 feedkeys("i" ..
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
77 \ "int main() {\<CR>" ..
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
78 \ "R\"(\<CR>" ..
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
79 \ ")\";\<CR>" ..
12238
0066a7e178bc patch 8.0.0999: indenting raw C++ strings is wrong
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
80 \ "statement;\<Esc>", "x")
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
81 assert_equal("\tstatement;", getline(line('.')))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
82
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
83 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
84 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
85
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
86 def Test_cindent_expr()
12323
4dba3e4f3b01 patch 8.0.1041: bogus characters when indenting during visual-block append
Christian Brabandt <cb@256bit.org>
parents: 12238
diff changeset
87 new
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
88 def g:MyIndentFunction(): number
12323
4dba3e4f3b01 patch 8.0.1041: bogus characters when indenting during visual-block append
Christian Brabandt <cb@256bit.org>
parents: 12238
diff changeset
89 return v:lnum == 1 ? shiftwidth() : 0
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
90 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
91 setl expandtab sw=8 indentkeys+=; indentexpr=g:MyIndentFunction()
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
92 var testinput =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
93 var_a = something()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
94 b = something()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16668
diff changeset
95 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
96 setline(1, testinput)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
97 cursor(1, 1)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
98 feedkeys("^\<c-v>j$A;\<esc>", 'tnix')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
99 var expected =<< [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
100 var_a = something();
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
101 b = something();
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
102 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
103 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
104
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
105 :%d
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
106 testinput =<< [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
107 var_a = something()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
108 b = something()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
109 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
110 setline(1, testinput)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
111 cursor(1, 1)
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
112 feedkeys("^\<c-v>j$A;\<esc>", 'tnix')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
113 expected =<< [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
114 var_a = something();
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
115 b = something()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
116 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
117 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
118
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
119 delfunc g:MyIndentFunction
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
120
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
121 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
122 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
123
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
124 def Test_cindent_func()
16668
81be817c9d9a patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 12323
diff changeset
125 new
81be817c9d9a patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 12323
diff changeset
126 setlocal cindent
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
127 setline(1, ['int main(void)', '{', 'return 0;', '}'])
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
128 assert_equal(-1, cindent(0))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
129 assert_equal(&sw, 3->cindent())
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
130 assert_equal(-1, cindent(line('$') + 1))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
131
16668
81be817c9d9a patch 8.1.1336: some eval functionality is not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 12323
diff changeset
132 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
133 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
134
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
135 def Test_cindent_1()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
136 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
137 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
138 setl cino& sts&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
139
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
140 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
141 /* start of AUTO matically checked vim: set ts=4 : */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
142 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
143 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
144 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
145 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
146 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
147
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
148 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
149 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
150 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
151 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
152 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
153 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
154
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
155 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
156 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
157 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
158 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
159 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
160 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
161 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
162
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
163 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
164 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
165 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
166 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
167 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
168 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
169 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
170
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
171 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
172 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
173 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
174 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
175 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
176 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
177
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
178 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
179 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
180 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
181 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
182 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
183 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
184 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
185
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
186 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
187 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
188 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
189 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
190 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
191
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
192 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
193 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
194 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
195
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
196 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
197 if (test) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
198 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
199 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
200
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
201 if (test) cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
202 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
203
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
204 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
205 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
206 for (blah)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
207 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
208 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
209 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
210 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
211 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
212
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
213 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
214 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
215 for (blah)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
216 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
217 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
218 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
219 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
220
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
221 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
222 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
223 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
224 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
225 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
226 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
227 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
228
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
229
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
230 /* Test for 'cindent' do/while mixed with if/else: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
231
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
232 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
233 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
234 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
235 asdfasd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
236 while (cond);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
237
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
238 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
239 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
240 while (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
241 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
242 while (asdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
243 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
244
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
245 /* Test for 'cindent' with two ) on a continuation line */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
246 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
247 if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
248 aal;sdkjf ( ;asldfkja;sldfk
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
249 al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
250 line up here;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
251 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
252
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
253
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
254 /* C++ tests: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
255
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
256 // foo() these three lines should remain in column 0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
257 // {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
258 // }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
259
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
260 /* Test for continuation and unterminated lines: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
261 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
262 i = 99 + 14325 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
263 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
264 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
265 21345 + ( 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
266 21345) +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
267 2345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
268 1234;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
269 c = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
270 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
271
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
272 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
273 testje for indent with empty line
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
274
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
275 here */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
276
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
277 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
278 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
279 not a joke ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
280 line up here)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
281 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
282 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
283 (not a joke || testing
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
284 )line up here)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
285 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
286 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
287 (not a joke || testing
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
288 line up here))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
289 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
290 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
291
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
292
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
293 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
294 switch (c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
295 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
296 case xx:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
297 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
298 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
299 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
300 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
301 while (asdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
302 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
303 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
304 while (cond);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
305 case yy:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
306 case xx:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
307 case zz:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
308 testing;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
309 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
310 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
311
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
312 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
313 if (cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
314 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
315 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
316 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
317 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
318 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
319 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
320 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
321
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
322 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
323 if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
324 alsdkfj (asldk;fj
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
325 awith cino=(0 ;lf this one goes to below the paren with ==
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
326 ;laksjfd ;lsakdjf ;alskdf asd)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
327 asdfasdf;)))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
328 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
329 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
330
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
331 int
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
332 func(a, b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
333 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
334 int c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
335 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
336 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
337 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
338 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
339 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
340 (c2 || c3)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
341 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
342 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
343
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
344 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
345 while (asd)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
346 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
347 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
348 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
349 if (that)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
350 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
351 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
352 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
353 cdasd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
354 while (as
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
355 df);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
356 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
357 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
358 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
359 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
360 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
361 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
362 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
363 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
364 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
365
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
366 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
367 s = "/*"; b = ';'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
368 s = "/*"; b = ';';
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
369 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
370 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
371
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
372 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
373 switch (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
374 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
375 case a:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
376 switch (t)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
377 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
378 case 1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
379 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
380 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
381 case 2:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
382 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
383 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
384 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
385 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
386 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
387 case b:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
388 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
389 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
390 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
391 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
392 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
393 case c: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
394 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
395 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
396 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
397 case d: if (cond &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
398 test) { /* this line doesn't work right */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
399 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
400 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
401 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
402 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
403 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
404 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
405
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
406 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
407 if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
408 (bp_to->b_p_initialized ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
409 (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
410 return;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
411 label :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
412 asdf = asdf ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
413 asdf : asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
414 asdf = asdf ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
415 asdf: asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
416 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
417
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
418 /* Special Comments : This function has the added complexity (compared */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
419 /* : to addtolist) of having to check for a detail */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
420 /* : texture and add that to the list first. */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
421
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
422 char *(array[100]) = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
423 "testje",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
424 "foo",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
425 "bar",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
426 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
427
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
428 enum soppie
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
429 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
430 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
431 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
432 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
433 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
434
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
435 typedef enum soppie
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
436 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
437 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
438 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
439 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
440 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
441
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
442 static enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
443 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
444 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
445 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
446 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
447 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
448
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
449 public static enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
450 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
451 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
452 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
453 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
454 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
455
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
456 static private enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
457 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
458 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
459 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
460 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
461 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
462
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
463 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
464 int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
465 b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
466 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
467
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
468 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
469 struct Type
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
470 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
471 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
472 char *str;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
473 } var[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
474 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
475 0, "zero",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
476 1, "one",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
477 2, "two",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
478 3, "three"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
479 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
480
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
481 float matrix[3][3] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
482 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
483 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
484 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
485 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
486 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
487 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
488 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
489 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
490 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
491 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
492 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
493 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
494 6,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
495 7,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
496 8
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
497 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
498 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
499 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
500
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
501 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
502 /* blah ( blah */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
503 /* where does this go? */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
504
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
505 /* blah ( blah */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
506 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
507
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
508 func(arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
509 /* comment */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
510 arg2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
511 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
512 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
513 b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
514 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
515 c; /* Hey, NOW it indents?! */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
516 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
517 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
518
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
519 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
520 func(arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
521 arg2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
522 arg3);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
523 /* Hey, what am I doing here? Is this coz of the ","? */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
524 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
525 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
526
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
527 main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
528 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
529 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
530 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
531 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
532 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
533 if (cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
534 a = c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
535 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
536 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
537 a = d;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
538 return;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
539 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
540
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
541 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
542 case 2: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
543 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
544 aasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
545 a = 9;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
546 case 3: if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
547 aasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
548 a = 9;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
549 case 4: x = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
550 y = 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
551
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
552 label: if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
553 here;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
554
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
555 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
556 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
557 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
558 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
559
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
560 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
561 asdfasdf) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
562 there;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
563 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
564
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
565 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
566 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
567 there;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
568 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
569
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
570 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
571 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
572 hello with ":set comments= cino=c5"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
573 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
574
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
575 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
576 hello with ":set comments= cino="
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
577 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
578 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
579
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
580
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
581 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
582 if (a < b) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
583 a = a + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
584 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
585 a = a + 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
586
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
587 if (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
588 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
589 testing;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
590 } while (asdfasdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
591 a = b + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
592 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
593 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
594
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
595 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
596 for ( int i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
597 i < 10; i++ )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
598 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
599 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
600 i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
601 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
602
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
603 class bob
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
604 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
605 int foo() {return 1;}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
606 int bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
607 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
608
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
609 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
610 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
611 while(1)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
612 if (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
613 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
614 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
615 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
616 else {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
617 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
618 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
619 misplacedline;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
620 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
621
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
622 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
623 if (clipboard.state == SELECT_DONE
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
624 && ((row == clipboard.start.lnum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
625 && col >= clipboard.start.col)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
626 || row > clipboard.start.lnum))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
627 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
628
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
629 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
630 if (1) {i += 4;}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
631 where_am_i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
632 return 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
633 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
634
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
635 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
636 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
637 } // sdf(asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
638 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
639 asd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
640 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
641
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
642 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
643 label1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
644 label2:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
645 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
646
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
647 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
648 int fooRet = foo(pBar1, false /*fKB*/,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
649 true /*fPTB*/, 3 /*nT*/, false /*fDF*/);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
650 f() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
651 for ( i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
652 i < m;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
653 /* c */ i++ ) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
654 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
655 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
656 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
657 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
658
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
659 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
660 f1(/*comment*/);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
661 f2();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
662 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
663
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
664 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
665 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
666 if (foo) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
667 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
668 ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
669 } while (foo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
670 foo(); // was wrong
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
671 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
672
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
673 int x; // no extra indent because of the ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
674 void func()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
675 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
676 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
677
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
678 char *tab[] = {"aaa",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
679 "};", /* }; */ NULL}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
680 int indented;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
681 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
682
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
683 char *a[] = {"aaa", "bbb",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
684 "ccc", NULL};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
685 // here
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
686
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
687 char *tab[] = {"aaa",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
688 "xx", /* xx */}; /* asdf */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
689 int not_indented;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
690
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
691 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
692 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
693 switch (bla)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
694 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
695 case 1: if (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
696 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
697 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
698 } while (boo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
699 wrong;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
700 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
701
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
702 int foo,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
703 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
704 int foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
705
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
706 #if defined(foo) \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
707 && defined(bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
708 char * xx = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
709 foo\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
710 bor";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
711 int x;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
712
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
713 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
714 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
715 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
716 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
717
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
718 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
719 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
720 #if defined(foo) \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
721 && defined(bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
722 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
723 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
724 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
725 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
726 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
727 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
728 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
729 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
730 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
731 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
732 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
733 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
734 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
735 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
736
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
737 int y; // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
738 // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
739
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
740 // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
741
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
742 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
743 Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
744 int b ) : BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
745 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
746 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
747 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
748
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
749 void foo()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
750 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
751 char one,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
752 two;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
753 struct bla piet,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
754 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
755 enum foo kees,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
756 jannie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
757 static unsigned sdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
758 krap;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
759 unsigned int piet,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
760 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
761 int
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
762 kees,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
763 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
764 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
765
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
766 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
767 t(int f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
768 int d); // )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
769 d();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
770 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
771
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
772 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
773 int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
774 ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
775 BaseClass(a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
776 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
777 c),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
778 mMember(b),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
779 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
780 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
781
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
782 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
783 int b ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
784 BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
785 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
786 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
787
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
788 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
789 int b ) /*x*/ : /*x*/ BaseClass(a),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
790 member(b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
791 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
792 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
793
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
794 A::A(int a, int b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
795 : aa(a),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
796 bb(b),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
797 cc(c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
798 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
799 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
800
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
801 class CAbc :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
802 public BaseClass1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
803 protected BaseClass2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
804 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
805 int Test() { return FALSE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
806 int Test1() { return TRUE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
807
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
808 CAbc(int a, int b ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
809 BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
810 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
811 switch(xxx)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
812 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
813 case abc:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
814 asdf();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
815 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
816
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
817 case 999:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
818 baer();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
819 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
820 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
821 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
822
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 19104
diff changeset
823 public: // <-- this was incorrectly indented before!!
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
824 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
825 protected:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
826 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
827 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
828
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
829 class CAbc : public BaseClass1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
830 protected BaseClass2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
831 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
832 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
833
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
834 static struct
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
835 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
836 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
837 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
838 } variable[COUNT] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
839 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
840 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
841 123,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
842 456
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
843 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
844 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
845 123,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
846 456
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
847 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
848 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
849
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
850 static struct
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
851 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
852 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
853 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
854 } variable[COUNT] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
855 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
856 { 123, 456 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
857 { 123, 456 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
858 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
859
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
860 void asdf() /* ind_maxparen may cause trouble here */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
861 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
862 if ((0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
863 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
864 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
865 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
866 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
867 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
868 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
869 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
870 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
871 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
872 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
873 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
874 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
875 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
876 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
877 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
878 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
879 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
880 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
881 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
882 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
883 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
884 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
885 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
886 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
887 && 1)) break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
888 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
889
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
890 foo()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
891 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
892 a = cond ? foo() : asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
893 + asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
894
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
895 a = cond ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
896 foo() : asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
897 + asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
898 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
899
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
900 int main(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
901 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
902 if (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
903 if (b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
904 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
905 else 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
906 next_line_of_code();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
907 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
908
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
909 barry()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
910 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
911 Foo::Foo (int one,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
912 int two)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
913 : something(4)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
914 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
915 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
916
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
917 barry()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
918 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
919 Foo::Foo (int one, int two)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
920 : something(4)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
921 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
922 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
923
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
924 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
925 int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
926 ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
927 BaseClass(a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
928 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
929 c),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
930 mMember(b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
931 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
932 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
933 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
934 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
935 if (lala)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
936 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
937 ++(*lolo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
938 while (lili
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
939 && lele);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
940 lulu;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
941 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
942
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
943 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
944 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
945 switch (c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
946 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
947 case 'c': if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
948 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
949 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
950 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
951 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
952
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
953 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
954 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
955 (void) MyFancyFuasdfadsfnction(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
956 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
957 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
958
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
959 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
960 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
961 char foo[] = "/*";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
962 /* as
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
963 df */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
964 hello
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
965 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
966
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
967 /* valid namespaces with normal indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
968 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
969 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
970 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
971 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
972 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
973 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
974 namespace /* test */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
975 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
976 11111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
977 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
978 namespace // test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
979 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
980 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
981 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
982 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
983 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
984 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
985 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
986 namespace test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
987 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
988 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
989 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
990 namespace{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
991 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
992 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
993 namespace test{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
994 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
995 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
996 namespace {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
997 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
998 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
999 namespace test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1000 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1001 namespace test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1002 22222222222222222;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1003 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1004 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1005 inline namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1006 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1007 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1008 inline /* test */ namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1009 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1010 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1011 inline/* test */namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1012 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1013 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1014
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1015 /* invalid namespaces use block indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1016 namespace test test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1017 111111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1018 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1019 namespace11111111111 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1020 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1021 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1022 namespace() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1023 1111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1024 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1025 namespace()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1026 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1027 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1028 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1029 namespace test test2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1030 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1031 1111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1032 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1033 namespace111111111
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1034 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1035 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1036 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1037 inlinenamespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1038 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1039 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1040
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1041 void getstring() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1042 /* Raw strings */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1043 const char* s = R"(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1044 test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1045 # comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1046 field: 123
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1047 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1048 )";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1049 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1050
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1051 void getstring() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1052 const char* s = R"foo(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1053 test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1054 # comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1055 field: 123
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1056 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1057 )foo";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1058 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1059
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1060 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1061 int a[4] = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1062 [0] = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1063 [1] = 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1064 [2] = 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1065 [3] = 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1066 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1067 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1068
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1069 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1070 a = b[2]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1071 + 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1072 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1073
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1074 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1075 if (1)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1076 /* aaaaa
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1077 * bbbbb
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1078 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1079 a = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1080 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1081
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1082 void func()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1083 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1084 switch (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1085 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1086 case (bar):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1087 if (baz())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1088 quux();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1089 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1090 case (shmoo):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1091 if (!bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1092 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1093 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1094 case (foo1):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1095 switch (bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1096 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1097 case baz:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1098 baz_f();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1099 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1100 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1101 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1102 default:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1103 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1104 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1105 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1106 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1107 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1108
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1109 /* end of AUTO */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1110 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1111
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
1112 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1113 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
1114 search('start of AUTO')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1115 exe "normal =/end of AUTO\<CR>"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1116
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
1117 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1118 /* start of AUTO matically checked vim: set ts=4 : */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1119 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1120 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1121 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1122 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1123 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1124
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1125 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1126 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1127 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1128 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1129 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1130 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1131
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1132 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1133 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1134 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1135 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1136 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1137 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1138 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1139
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1140 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1141 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1142 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1143 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1144 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1145 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1146 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1147
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1148 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1149 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1150 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1151 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1152 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1153 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1154
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1155 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1156 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1157 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1158 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1159 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1160 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1161 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1162
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1163 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1164 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1165 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1166 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1167 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1168
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1169 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1170 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1171 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1172
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1173 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1174 if (test) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1175 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1176 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1177
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1178 if (test) cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1179 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1180
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1181 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1182 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1183 for (blah)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1184 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1185 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1186 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1187 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1188 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1189
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1190 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1191 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1192 for (blah)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1193 while (this)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1194 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1195 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1196 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1197
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1198 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1199 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1200 cmd1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1201 cmd2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1202 cmd3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1203 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1204 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1205
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1206
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1207 /* Test for 'cindent' do/while mixed with if/else: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1208
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1209 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1210 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1211 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1212 asdfasd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1213 while (cond);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1214
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1215 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1216 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1217 while (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1218 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1219 while (asdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1220 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1221
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1222 /* Test for 'cindent' with two ) on a continuation line */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1223 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1224 if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1225 aal;sdkjf ( ;asldfkja;sldfk
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1226 al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1227 line up here;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1228 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1229
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1230
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1231 /* C++ tests: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1232
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1233 // foo() these three lines should remain in column 0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1234 // {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1235 // }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1236
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1237 /* Test for continuation and unterminated lines: */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1238 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1239 i = 99 + 14325 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1240 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1241 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1242 21345 + ( 21345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1243 21345) +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1244 2345 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1245 1234;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1246 c = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1247 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1248
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1249 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1250 testje for indent with empty line
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1251
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1252 here */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1253
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1254 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1255 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1256 not a joke ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1257 line up here)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1258 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1259 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1260 (not a joke || testing
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1261 )line up here)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1262 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1263 if (testing &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1264 (not a joke || testing
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1265 line up here))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1266 hay;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1267 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1268
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1269
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1270 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1271 switch (c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1272 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1273 case xx:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1274 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1275 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1276 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1277 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1278 while (asdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1279 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1280 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1281 while (cond);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1282 case yy:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1283 case xx:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1284 case zz:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1285 testing;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1286 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1287 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1288
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1289 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1290 if (cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1291 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1292 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1293 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1294 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1295 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1296 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1297 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1298
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1299 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1300 if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1301 alsdkfj (asldk;fj
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1302 awith cino=(0 ;lf this one goes to below the paren with ==
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1303 ;laksjfd ;lsakdjf ;alskdf asd)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1304 asdfasdf;)))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1305 asdfasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1306 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1307
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1308 int
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1309 func(a, b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1310 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1311 int c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1312 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1313 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1314 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1315 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1316 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1317 (c2 || c3)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1318 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1319 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1320
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1321 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1322 while (asd)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1323 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1324 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1325 if (test)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1326 if (that)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1327 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1328 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1329 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1330 cdasd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1331 while (as
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1332 df);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1333 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1334 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1335 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1336 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1337 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1338 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1339 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1340 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1341 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1342
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1343 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1344 s = "/*"; b = ';'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1345 s = "/*"; b = ';';
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1346 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1347 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1348
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1349 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1350 switch (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1351 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1352 case a:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1353 switch (t)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1354 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1355 case 1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1356 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1357 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1358 case 2:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1359 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1360 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1361 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1362 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1363 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1364 case b:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1365 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1366 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1367 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1368 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1369 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1370 case c: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1371 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1372 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1373 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1374 case d: if (cond &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1375 test) { /* this line doesn't work right */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1376 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1377 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1378 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1379 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1380 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1381 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1382
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1383 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1384 if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1385 (bp_to->b_p_initialized ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1386 (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1387 return;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1388 label :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1389 asdf = asdf ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1390 asdf : asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1391 asdf = asdf ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1392 asdf: asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1393 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1394
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1395 /* Special Comments : This function has the added complexity (compared */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1396 /* : to addtolist) of having to check for a detail */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1397 /* : texture and add that to the list first. */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1398
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1399 char *(array[100]) = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1400 "testje",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1401 "foo",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1402 "bar",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1403 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1404
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1405 enum soppie
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1406 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1407 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1408 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1409 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1410 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1411
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1412 typedef enum soppie
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1413 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1414 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1415 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1416 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1417 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1418
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1419 static enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1420 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1421 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1422 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1423 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1424 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1425
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1426 public static enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1427 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1428 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1429 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1430 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1431 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1432
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1433 static private enum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1434 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1435 yes = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1436 no,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1437 maybe
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1438 } soppie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1439
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1440 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1441 int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1442 b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1443 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1444
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1445 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1446 struct Type
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1447 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1448 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1449 char *str;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1450 } var[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1451 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1452 0, "zero",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1453 1, "one",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1454 2, "two",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1455 3, "three"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1456 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1457
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1458 float matrix[3][3] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1459 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1460 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1461 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1462 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1463 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1464 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1465 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1466 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1467 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1468 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1469 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1470 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1471 6,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1472 7,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1473 8
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1474 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1475 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1476 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1477
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1478 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1479 /* blah ( blah */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1480 /* where does this go? */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1481
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1482 /* blah ( blah */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1483 cmd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1484
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1485 func(arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1486 /* comment */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1487 arg2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1488 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1489 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1490 b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1491 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1492 c; /* Hey, NOW it indents?! */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1493 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1494 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1495
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1496 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1497 func(arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1498 arg2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1499 arg3);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1500 /* Hey, what am I doing here? Is this coz of the ","? */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1501 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1502 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1503
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1504 main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1505 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1506 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1507 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1508 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1509 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1510 if (cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1511 a = c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1512 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1513 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1514 a = d;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1515 return;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1516 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1517
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1518 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1519 case 2: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1520 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1521 aasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1522 a = 9;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1523 case 3: if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1524 aasdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1525 a = 9;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1526 case 4: x = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1527 y = 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1528
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1529 label: if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1530 here;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1531
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1532 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1533 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1534 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1535 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1536
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1537 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1538 asdfasdf) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1539 there;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1540 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1541
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1542 label: if (asdf &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1543 asdfasdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1544 there;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1545 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1546
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1547 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1548 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1549 hello with ":set comments= cino=c5"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1550 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1551
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1552 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1553 hello with ":set comments= cino="
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1554 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1555 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1556
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1557
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1558 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1559 if (a < b) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1560 a = a + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1561 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1562 a = a + 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1563
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1564 if (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1565 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1566 testing;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1567 } while (asdfasdf);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1568 a = b + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1569 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1570 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1571
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1572 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1573 for ( int i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1574 i < 10; i++ )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1575 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1576 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1577 i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1578 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1579
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1580 class bob
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1581 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1582 int foo() {return 1;}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1583 int bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1584 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1585
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1586 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1587 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1588 while(1)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1589 if (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1590 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1591 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1592 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1593 else {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1594 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1595 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1596 misplacedline;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1597 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1598
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1599 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1600 if (clipboard.state == SELECT_DONE
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1601 && ((row == clipboard.start.lnum
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1602 && col >= clipboard.start.col)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1603 || row > clipboard.start.lnum))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1604 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1605
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1606 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1607 if (1) {i += 4;}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1608 where_am_i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1609 return 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1610 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1611
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1612 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1613 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1614 } // sdf(asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1615 if (asdf)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1616 asd;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1617 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1618
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1619 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1620 label1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1621 label2:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1622 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1623
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1624 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1625 int fooRet = foo(pBar1, false /*fKB*/,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1626 true /*fPTB*/, 3 /*nT*/, false /*fDF*/);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1627 f() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1628 for ( i = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1629 i < m;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1630 /* c */ i++ ) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1631 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1632 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1633 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1634 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1635
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1636 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1637 f1(/*comment*/);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1638 f2();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1639 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1640
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1641 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1642 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1643 if (foo) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1644 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1645 ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1646 } while (foo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1647 foo(); // was wrong
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1648 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1649
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1650 int x; // no extra indent because of the ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1651 void func()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1652 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1653 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1654
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1655 char *tab[] = {"aaa",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1656 "};", /* }; */ NULL}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1657 int indented;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1658 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1659
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1660 char *a[] = {"aaa", "bbb",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1661 "ccc", NULL};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1662 // here
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1663
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1664 char *tab[] = {"aaa",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1665 "xx", /* xx */}; /* asdf */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1666 int not_indented;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1667
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1668 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1669 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1670 switch (bla)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1671 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1672 case 1: if (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1673 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1674 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1675 } while (boo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1676 wrong;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1677 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1678
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1679 int foo,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1680 bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1681 int foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1682
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1683 #if defined(foo) \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1684 && defined(bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1685 char * xx = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1686 foo\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1687 bor";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1688 int x;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1689
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1690 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1691 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1692 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1693 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1694
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1695 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1696 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1697 #if defined(foo) \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1698 && defined(bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1699 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1700 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1701 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1702 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1703 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1704 int i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1705 char *foo = "asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1706 asdf\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1707 asdf",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1708 *bar;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1709 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1710 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1711 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1712 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1713
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1714 int y; // comment
26516
9596c652420b patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents: 26187
diff changeset
1715 // comment
9596c652420b patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents: 26187
diff changeset
1716
9596c652420b patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents: 26187
diff changeset
1717 // comment
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1718
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1719 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1720 Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1721 int b ) : BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1722 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1723 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1724 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1725
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1726 void foo()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1727 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1728 char one,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1729 two;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1730 struct bla piet,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1731 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1732 enum foo kees,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1733 jannie;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1734 static unsigned sdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1735 krap;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1736 unsigned int piet,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1737 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1738 int
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1739 kees,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1740 jan;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1741 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1742
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1743 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1744 t(int f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1745 int d); // )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1746 d();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1747 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1748
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1749 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1750 int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1751 ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1752 BaseClass(a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1753 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1754 c),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1755 mMember(b),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1756 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1757 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1758
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1759 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1760 int b ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1761 BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1762 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1763 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1764
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1765 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1766 int b ) /*x*/ : /*x*/ BaseClass(a),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1767 member(b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1768 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1769 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1770
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1771 A::A(int a, int b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1772 : aa(a),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1773 bb(b),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1774 cc(c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1775 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1776 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1777
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1778 class CAbc :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1779 public BaseClass1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1780 protected BaseClass2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1781 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1782 int Test() { return FALSE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1783 int Test1() { return TRUE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1784
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1785 CAbc(int a, int b ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1786 BaseClass(a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1787 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1788 switch(xxx)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1789 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1790 case abc:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1791 asdf();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1792 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1793
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1794 case 999:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1795 baer();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1796 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1797 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1798 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1799
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 19104
diff changeset
1800 public: // <-- this was incorrectly indented before!!
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1801 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1802 protected:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1803 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1804 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1805
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1806 class CAbc : public BaseClass1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1807 protected BaseClass2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1808 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1809 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1810
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1811 static struct
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1812 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1813 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1814 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1815 } variable[COUNT] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1816 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1817 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1818 123,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1819 456
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1820 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1821 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1822 123,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1823 456
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1824 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1825 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1826
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1827 static struct
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1828 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1829 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1830 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1831 } variable[COUNT] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1832 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1833 { 123, 456 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1834 { 123, 456 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1835 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1836
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1837 void asdf() /* ind_maxparen may cause trouble here */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1838 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1839 if ((0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1840 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1841 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1842 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1843 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1844 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1845 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1846 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1847 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1848 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1849 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1850 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1851 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1852 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1853 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1854 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1855 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1856 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1857 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1858 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1859 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1860 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1861 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1862 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1863 && 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1864 && 1)) break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1865 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1866
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1867 foo()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1868 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1869 a = cond ? foo() : asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1870 + asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1871
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1872 a = cond ?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1873 foo() : asdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1874 + asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1875 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1876
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1877 int main(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1878 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1879 if (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1880 if (b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1881 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1882 else 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1883 next_line_of_code();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1884 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1885
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1886 barry()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1887 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1888 Foo::Foo (int one,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1889 int two)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1890 : something(4)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1891 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1892 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1893
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1894 barry()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1895 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1896 Foo::Foo (int one, int two)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1897 : something(4)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1898 {}
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1899 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1900
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1901 Constructor::Constructor(int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1902 int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1903 ) :
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1904 BaseClass(a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1905 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1906 c),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1907 mMember(b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1908 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1909 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1910 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1911 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1912 if (lala)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1913 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1914 ++(*lolo);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1915 while (lili
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1916 && lele);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1917 lulu;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1918 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1919
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1920 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1921 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1922 switch (c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1923 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1924 case 'c': if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1925 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1926 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1927 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1928 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1929
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1930 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1931 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1932 (void) MyFancyFuasdfadsfnction(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1933 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1934 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1935
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1936 main()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1937 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1938 char foo[] = "/*";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1939 /* as
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1940 df */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1941 hello
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1942 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1943
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1944 /* valid namespaces with normal indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1945 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1946 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1947 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1948 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1949 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1950 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1951 namespace /* test */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1952 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1953 11111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1954 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1955 namespace // test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1956 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1957 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1958 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1959 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1960 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1961 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1962 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1963 namespace test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1964 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1965 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1966 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1967 namespace{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1968 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1969 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1970 namespace test{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1971 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1972 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1973 namespace {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1974 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1975 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1976 namespace test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1977 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1978 namespace test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1979 22222222222222222;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1980 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1981 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1982 inline namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1983 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1984 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1985 inline /* test */ namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1986 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1987 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1988 inline/* test */namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1989 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
1990 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1991
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1992 /* invalid namespaces use block indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1993 namespace test test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1994 111111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1995 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1996 namespace11111111111 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1997 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1998 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
1999 namespace() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2000 1111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2001 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2002 namespace()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2003 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2004 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2005 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2006 namespace test test2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2007 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2008 1111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2009 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2010 namespace111111111
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2011 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2012 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2013 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
2014 inlinenamespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
2015 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
2016 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2017
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2018 void getstring() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2019 /* Raw strings */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2020 const char* s = R"(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2021 test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2022 # comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2023 field: 123
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2024 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2025 )";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2026 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2027
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2028 void getstring() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2029 const char* s = R"foo(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2030 test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2031 # comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2032 field: 123
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2033 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2034 )foo";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2035 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2036
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2037 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2038 int a[4] = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2039 [0] = 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2040 [1] = 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2041 [2] = 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2042 [3] = 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2043 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2044 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2045
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2046 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2047 a = b[2]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2048 + 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2049 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2050
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2051 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2052 if (1)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2053 /* aaaaa
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2054 * bbbbb
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2055 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2056 a = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2057 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2058
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2059 void func()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2060 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2061 switch (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2062 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2063 case (bar):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2064 if (baz())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2065 quux();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2066 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2067 case (shmoo):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2068 if (!bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2069 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2070 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2071 case (foo1):
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2072 switch (bar)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2073 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2074 case baz:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2075 baz_f();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2076 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2077 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2078 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2079 default:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2080 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2081 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2082 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2083 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2084 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2085
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2086 /* end of AUTO */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2087
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2088 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2089
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2090 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2091
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2092 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2093 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2094
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2095 def Test_cindent_2()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2096 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2097 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2098 setl tw=0 noai fo=croq
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2099 &wm = &columns - 20
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2100
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2101 var code =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2102 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2103
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2104 /* this is
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2105 * a real serious important big
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2106 * comment
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2107 */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2108 /* insert " about life, the universe, and the rest" after "serious" */
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
2109 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2110 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2111
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2112 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2113 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2114 search('serious', 'e')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2115 normal a about life, the universe, and the rest
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2116
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2117 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2118 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2119
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2120 /* this is
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2121 * a real serious
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2122 * about life, the
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2123 * universe, and the
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2124 * rest important big
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2125 * comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2126 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2127 /* insert " about life, the universe, and the rest" after "serious" */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2128 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2129
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2130 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2131
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2132 assert_equal(expected, getline(1, '$'))
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2133 set wm&
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2134
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2135 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2136 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2137
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2138 def Test_cindent_3()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2139 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2140 setl nocindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2141
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2142 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2143 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2144 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2145 * Testing for comments, without 'cin' set
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2146 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2147
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2148 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2149 * what happens here?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2150 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2151
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2152 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2153 the end of the comment, try inserting a line below */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2154
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2155 /* how about
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2156 this one */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2157 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2158 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2159
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2160 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2161 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2162 search('comments')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2163 normal joabout life
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2164 search('happens')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2165 normal jothere
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2166 search('below')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2167 normal oline
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2168 search('this')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2169 normal Ohello
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2170
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2171 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2172 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2173 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2174 * Testing for comments, without 'cin' set
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2175 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2176 about life
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2177
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2178 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2179 * what happens here?
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2180 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2181 there
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2182
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2183 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2184 the end of the comment, try inserting a line below */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2185 line
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2186
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2187 /* how about
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2188 hello
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2189 this one */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2190 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2191
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2192 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2193
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2194 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2195
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2196 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2197 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2198
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2199 def Test_cindent_4()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2200 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2201 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2202
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2203 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2204 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2205 var = this + that + vec[0] * vec[0]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2206 + vec[1] * vec[1]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2207 + vec2[2] * vec[2];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2208 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2209 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2210
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2211 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2212 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2213 search('vec2')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2214 normal ==
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2215
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2216 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2217 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2218 var = this + that + vec[0] * vec[0]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2219 + vec[1] * vec[1]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2220 + vec2[2] * vec[2];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2221 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2222
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2223 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2224
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2225 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2226
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2227 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2228 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2229
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2230 def Test_cindent_5()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2231 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2232 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2233 setl cino=}4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2234
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2235 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2236 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2237 asdf asdflkajds f;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2238 if (tes & ting) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2239 asdf asdf asdf ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2240 asdfa sdf asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2241 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2242 testing1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2243 if (tes & ting)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2244 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2245 asdf asdf asdf ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2246 asdfa sdf asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2247 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2248 testing2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2249 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2250 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2251
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2252 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2253 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2254 search('testing1')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2255 exe "normal k2==/testing2\<CR>"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2256 normal k2==
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2257
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2258 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2259 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2260 asdf asdflkajds f;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2261 if (tes & ting) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2262 asdf asdf asdf ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2263 asdfa sdf asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2264 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2265 testing1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2266 if (tes & ting)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2267 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2268 asdf asdf asdf ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2269 asdfa sdf asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2270 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2271 testing2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2272 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2273
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2274 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2275
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2276 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2277
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2278 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2279 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2280
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2281 def Test_cindent_6()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2282 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2283 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2284 setl cino=(0,)20
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2285
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2286 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2287 main ( int first_par, /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2288 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2289 * first par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2290 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2291 int second_par /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2292 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2293 * second par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2294 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2295 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2296 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2297 func( first_par, /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2298 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2299 * first par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2300 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2301 second_par /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2302 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2303 * second par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2304 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2305 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2306
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2307 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2308 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2309
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2310 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2311 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2312 search('main')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2313 normal =][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2314
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2315 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2316 main ( int first_par, /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2317 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2318 * first par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2319 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2320 int second_par /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2321 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2322 * second par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2323 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2324 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2325 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2326 func( first_par, /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2327 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2328 * first par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2329 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2330 second_par /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2331 * Comment for
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2332 * second par
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2333 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2334 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2335
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2336 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2337
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2338 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2339
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2340 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2341
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2342 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2343 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2344
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2345 def Test_cindent_7()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2346 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2347 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2348 setl cino=es,n0s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2349
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2350 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2351 main(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2352 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2353 /* Make sure that cino=X0s is not parsed like cino=Xs. */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2354 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2355 foo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2356 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2357 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2358 bar();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2359 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2360 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2361 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2362
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2363 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2364 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2365 search('main')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2366 normal =][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2367
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2368 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2369 main(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2370 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2371 /* Make sure that cino=X0s is not parsed like cino=Xs. */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2372 if (cond)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2373 foo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2374 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2375 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2376 bar();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2377 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2378 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2379
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2380 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2381 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2382
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2383 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2384 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2385
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2386 def Test_cindent_8()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2387 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2388 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2389 setl cino=
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2390
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2391 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2392
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2393 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2394 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2395 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2396 if ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2397 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2398 if ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2399 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2400 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2401 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2402 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2403 } while ();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2404 cmd; /* this should go under the } */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2405 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2406 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2407
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2408 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2409 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2410 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2411
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2412 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2413
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2414 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2415 do
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2416 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2417 if ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2418 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2419 if ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2420 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2421 else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2422 asdf;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2423 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2424 } while ();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2425 cmd; /* this should go under the } */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2426 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2427
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2428 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2429
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2430 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2431
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2432 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2433 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2434
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2435 def Test_cindent_9()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2436 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2437 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2438
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2439 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2440
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2441 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2442 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2443 if ( k() ) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2444 l();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2445
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2446 } else { /* Start (two words) end */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2447 m();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2448 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2449
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2450 n();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2451 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2452 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2453
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2454 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2455 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2456 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2457
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2458 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2459
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2460 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2461 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2462 if ( k() ) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2463 l();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2464
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2465 } else { /* Start (two words) end */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2466 m();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2467 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2468
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2469 n();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2470 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2471
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2472 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2473
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2474 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2475
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2476 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2477 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2478
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2479 def Test_cindent_10()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2480 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2481 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2482 setl cino={s,e-s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2483
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2484 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2485
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2486 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2487 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2488 if ( k() )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2489 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2490 l();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2491 } else { /* Start (two words) end */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2492 m();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2493 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2494 n(); /* should be under the if () */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2495 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2496 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2497
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2498 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2499 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2500 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2501
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2502 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2503
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2504 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2505 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2506 if ( k() )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2507 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2508 l();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2509 } else { /* Start (two words) end */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2510 m();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2511 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2512 n(); /* should be under the if () */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2513 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2514
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2515 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2516
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2517 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2518
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2519 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2520 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2521
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2522 def Test_cindent_11()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2523 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2524 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2525 setl cino={s,fs
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2526
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2527 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2528 void bar(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2529 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2530 static array[2][2] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2531 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2532 { 1, 2 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2533 { 3, 4 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2534 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2535
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2536 while (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2537 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2538 foo(&a);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2539 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2540
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2541 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2542 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2543 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2544 a = a + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2545 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2546 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2547 b = a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2548 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2549
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2550 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2551 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2552 a = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2553 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2554 b = 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2555 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2556 c = 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2557 d = 4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2558 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2559 /* foo */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2560 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2561
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2562 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2563 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2564 exe "normal ]]=/ foo\<CR>"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2565
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2566 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2567 void bar(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2568 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2569 static array[2][2] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2570 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2571 { 1, 2 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2572 { 3, 4 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2573 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2574
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2575 while (a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2576 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2577 foo(&a);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2578 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2579
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2580 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2581 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2582 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2583 a = a + 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2584 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2585 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2586 b = a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2587 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2588
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2589 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2590 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2591 a = 1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2592 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2593 b = 2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2594 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2595 c = 3;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2596 d = 4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2597 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2598 /* foo */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2599
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2600 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2601 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2602
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2603 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2604 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2605
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2606 def Test_cindent_12()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2607 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2608 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2609 setl cino=
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2610
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2611 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2612 a()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2613 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2614 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2615 a = a +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2616 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2617 } while ( a ); /* add text under this line */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2618 if ( a )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2619 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2620 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2621 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2622
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2623 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2624 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2625 search('while')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2626 normal ohere
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2627
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2628 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2629 a()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2630 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2631 do {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2632 a = a +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2633 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2634 } while ( a ); /* add text under this line */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2635 here
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2636 if ( a )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2637 a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2638 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2639
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2640 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2641 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2642
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2643 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2644 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2645
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2646 def Test_cindent_13()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2647 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2648 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2649 setl cino= com=
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2650
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2651 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2652 a()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2653 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2654 label1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2655 /* hmm */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2656 // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2657 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2658 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2659
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2660 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2661 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2662 search('comment')
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2663 exe "normal olabel2: b();\rlabel3 /* post */:\r/* pre */ label4:\r"
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2664 .. "f(/*com*/);\rif (/*com*/)\rcmd();"
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2665
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2666 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2667 a()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2668 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2669 label1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2670 /* hmm */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2671 // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2672 label2: b();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2673 label3 /* post */:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2674 /* pre */ label4:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2675 f(/*com*/);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2676 if (/*com*/)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2677 cmd();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2678 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2679
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2680 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2681 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2682
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2683 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2684 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2685
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2686 def Test_cindent_14()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2687 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2688 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2689 setl comments& comments^=s:/*,m:**,ex:*/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2690
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2691 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2692 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2693 * A simple comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2694 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2695
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2696 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2697 ** A different comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2698 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2699 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2700
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2701 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2702 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2703 search('simple')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2704 normal =5j
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2705
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2706 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2707 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2708 * A simple comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2709 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2710
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2711 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2712 ** A different comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2713 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2714
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2715 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2716 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2717
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2718 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2719 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2720
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2721 def Test_cindent_15()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2722 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2723 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2724 setl cino=c0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2725 setl comments& comments-=s1:/* comments^=s0:/*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2726
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2727 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2728 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2729 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2730
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2731 /*********
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2732 A comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2733 *********/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2734 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2735 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2736
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2737 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2738 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2739 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2740
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2741 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2742 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2743 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2744
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2745 /*********
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2746 A comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2747 *********/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2748 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2749
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2750 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2751 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2752
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2753 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2754 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2755
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2756 def Test_cindent_16()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2757 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2758 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2759 setl cino=c0,C1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2760 setl comments& comments-=s1:/* comments^=s0:/*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2761
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2762 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2763 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2764 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2765
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2766 /*********
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2767 A comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2768 *********/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2769 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2770 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2771
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2772 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2773 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2774 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2775
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2776 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2777 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2778 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2779
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2780 /*********
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2781 A comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2782 *********/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2783 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2784
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2785 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2786 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2787
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2788 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2789 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2790
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2791 def Test_cindent_17()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2792 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2793 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2794 setl cino=
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2795
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2796 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2797 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2798 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2799 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2800 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2801 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2802 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2803 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2804 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2805 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2806
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2807 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2808 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2809 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2810
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2811 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2812 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2813 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2814 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2815 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2816 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2817 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2818 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2819 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2820
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2821 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2822 call assert_equal(expected, getline(1, '$'))
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2823
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2824 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2825 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2826
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2827 def Test_cindent_18()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2828 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2829 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2830 setl cino=(s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2831
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2832 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2833 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2834 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2835 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2836 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2837 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2838 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2839 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2840 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2841 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2842
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2843 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2844 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2845 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2846
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2847 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2848 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2849 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2850 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2851 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2852 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2853 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2854 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2855 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2856
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2857 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2858 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2859
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2860 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2861 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2862
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2863 def Test_cindent_19()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2864 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2865 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2866 set cino=(s,U1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2867
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2868 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2869 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2870 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2871 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2872 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2873 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2874 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2875 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2876 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2877 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2878
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2879 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2880 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2881 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2882
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2883 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2884 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2885 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2886 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2887 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2888 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2889 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2890 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2891 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2892
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2893 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2894 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2895
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2896 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2897 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2898
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2899 def Test_cindent_20()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2900 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2901 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2902 setl cino=(0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2903
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2904 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2905 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2906 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2907 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2908 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2909 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2910 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2911 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2912 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2913
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2914 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2915 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2916 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2917
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2918 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2919 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2920 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2921 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2922 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2923 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2924 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2925 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2926
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2927 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2928 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2929
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2930 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2931 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2932
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2933 def Test_cindent_21()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2934 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2935 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2936 setl cino=(0,w1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2937
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2938 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2939 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2940 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2941 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2942 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2943 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2944 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2945 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2946 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2947
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2948 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2949 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2950 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2951
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2952 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2953 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2954 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2955 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2956 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2957 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2958 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2959 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2960
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2961 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2962 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2963
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2964 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2965 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2966
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2967 def Test_cindent_22()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2968 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2969 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2970 setl cino=(s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2971
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2972 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2973 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2974 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2975 c = c1 && (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2976 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2977 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2978 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2979 if (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2980 c1 && c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2981 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2982 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2983 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2984 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2985
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2986 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2987 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2988 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2989
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
2990 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2991 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2992 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2993 c = c1 && (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2994 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2995 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2996 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2997 if (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2998 c1 && c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
2999 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3000 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3001 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3002
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3003 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3004 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3005
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3006 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3007 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3008
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3009 def Test_cindent_23()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3010 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3011 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3012 setl cino=(s,m1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3013
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3014 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3015 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3016 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3017 c = c1 && (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3018 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3019 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3020 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3021 if (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3022 c1 && c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3023 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3024 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3025 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3026 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3027
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3028 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3029 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3030 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3031
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3032 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3033 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3034 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3035 c = c1 && (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3036 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3037 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3038 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3039 if (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3040 c1 && c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3041 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3042 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3043 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3044
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3045 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3046 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3047
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3048 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3049 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3050
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3051 def Test_cindent_24()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3052 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3053 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3054 setl cino=b1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3055
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3056 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3057 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3058 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3059 switch (x)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3060 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3061 case 1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3062 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3063 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3064 default:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3065 a = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3066 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3067 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3068 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3069 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3070
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3071 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3072 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3073 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3074
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3075 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3076 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3077 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3078 switch (x)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3079 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3080 case 1:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3081 a = b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3082 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3083 default:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3084 a = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3085 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3086 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3087 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3088
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3089 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3090 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3091
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3092 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3093 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3094
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3095 def Test_cindent_25()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3096 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3097 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3098 setl cino=(0,W5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3099
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3100 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3101 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3102 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3103 invokeme(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3104 argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3105 ment);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3106 invokeme(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3107 argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3108 ment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3109 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3110 invokeme(argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3111 ment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3112 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3113 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3114 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3115
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3116 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3117 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3118 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3119
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3120 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3121 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3122 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3123 invokeme(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3124 argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3125 ment);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3126 invokeme(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3127 argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3128 ment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3129 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3130 invokeme(argu,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3131 ment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3132 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3133 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3134
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3135 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3136 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3137
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3138 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3139 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3140
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3141 def Test_cindent_26()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3142 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3143 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3144 setl cino=/6
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3145
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3146 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3147 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3148 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3149 statement;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3150 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3151 // comment 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3152 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3153 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3154
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3155 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3156 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3157 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3158
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3159 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3160 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3161 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3162 statement;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3163 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3164 // comment 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3165 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3166
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3167 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3168 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3169
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3170 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3171 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3172
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3173 def Test_cindent_27()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3174 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3175 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3176 setl cino=
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3177
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3178 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3179 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3180 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3181 statement;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3182 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3183 // comment 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3184 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3185 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3186
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3187 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3188 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3189 exe "normal ]]/comment 1/+1\<CR>=="
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3190
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3191 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3192 void f()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3193 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3194 statement;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3195 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3196 // comment 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3197 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3198
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3199 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3200 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3201
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3202 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3203 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3204
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3205 def Test_cindent_28()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3206 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3207 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3208 setl cino=g0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3209
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3210 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3211 class CAbc
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3212 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3213 int Test() { return FALSE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3214
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3215 public: // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3216 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3217 protected:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3218 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3219 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3220 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3221
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3222 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3223 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3224 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3225
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3226 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3227 class CAbc
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3228 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3229 int Test() { return FALSE; }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3230
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3231 public: // comment
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3232 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3233 protected:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3234 void testfall();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3235 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3236
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3237 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3238 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3239
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3240 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3241 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3242
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3243 def Test_cindent_29()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3244 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3245 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3246 setl cino=(0,gs,hs
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3247
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3248 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3249 class Foo : public Bar
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3250 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3251 public:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3252 virtual void method1(void) = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3253 virtual void method2(int arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3254 int arg2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3255 int arg3) = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3256 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3257 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3258
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3259 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3260 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3261 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3262
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3263 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3264 class Foo : public Bar
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3265 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3266 public:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3267 virtual void method1(void) = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3268 virtual void method2(int arg1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3269 int arg2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3270 int arg3) = 0;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3271 };
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3272
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3273 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3274 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3275
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3276 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3277 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3278
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3279 def Test_cindent_30()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3280 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3281 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3282 setl cino=+20
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3283
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3284 var code =<< [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3285 void
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3286 foo()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3287 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3288 if (a)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3289 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3290 } else
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3291 asdf;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3292 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3293 [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3294
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3295 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3296 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3297 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3298
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3299 var expected =<< [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3300 void
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3301 foo()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3302 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3303 if (a)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3304 {
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3305 } else
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3306 asdf;
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3307 }
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3308
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3309 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3310 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3311
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3312 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3313 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3314
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3315 def Test_cindent_31()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3316 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3317 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3318 setl cino=(0,W2s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3319
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3320 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3321
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3322 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3323 averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3324 asdasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3325 func(asdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3326 asdfadsf),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3327 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3328 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3329
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3330 /* those are ugly, but consequent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3331
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3332 func()->asd(asdasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3333 averylongfunctionname(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3334 abc,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3335 dec)->averylongfunctionname(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3336 asdfadsf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3337 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3338 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3339 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3340 func(asdfadf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3341 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3342 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3343 asdasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3344 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3346 averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3347 abc,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3348 dec)->asdfasdfasdf(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3349 asdfadsf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3350 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3351 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3352 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3353 func(asdfadf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3354 asdfasdf),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3355 asdasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3356 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3357 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3358 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3359
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3360 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3361 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3362 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3363
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3364 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3365
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3366 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3367 averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3368 asdasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3369 func(asdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3370 asdfadsf),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3371 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3372 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3373
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3374 /* those are ugly, but consequent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3375
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3376 func()->asd(asdasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3377 averylongfunctionname(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3378 abc,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3379 dec)->averylongfunctionname(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3380 asdfadsf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3381 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3382 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3383 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3384 func(asdfadf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3385 asdfasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3386 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3387 asdasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3388 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3389
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3390 averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3391 abc,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3392 dec)->asdfasdfasdf(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3393 asdfadsf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3394 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3395 asdfasdf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3396 ),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3397 func(asdfadf,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3398 asdfasdf),
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3399 asdasdf
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3400 );
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3401 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3402
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3403 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3404 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3405
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3406 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3407 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3408
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3409 def Test_cindent_32()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3410 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3411 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3412 setl cino=M1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3413
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3414 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3415 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3416 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3417 if (cond1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3418 cond2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3419 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3420 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3421 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3422 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3423
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3424 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3425 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3426 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3427
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3428 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3429 int main ()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3430 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3431 if (cond1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3432 cond2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3433 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3434 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3435 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3436
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3437 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3438 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3439
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3440 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3441 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3442
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3443 def Test_cindent_33()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3444 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3445 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3446 setl cino=(0,ts
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3447
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3448 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3449 void func(int a
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3450 #if defined(FOO)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3451 , int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3452 , int c
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3453 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3454 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3455 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3456 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3457 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3458
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3459 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3460 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3461 normal 2j=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3462
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3463 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3464 void func(int a
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3465 #if defined(FOO)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3466 , int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3467 , int c
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3468 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3469 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3470 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3471 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3472
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3473 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3474 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3475
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3476 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3477 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3478
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3479 def Test_cindent_34()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3480 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3481 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3482 setl cino=(0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3483
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3484 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3485
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3486 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3487 func(int a
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3488 #if defined(FOO)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3489 , int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3490 , int c
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3491 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3492 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3493 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3494 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3495 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3496
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3497 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3498 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3499 normal =][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3500
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3501 var expected =<< trim [CODE]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16865
diff changeset
3502
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3503 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3504 func(int a
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3505 #if defined(FOO)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3506 , int b
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3507 , int c
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3508 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3509 )
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3510 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3511 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3512
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3513 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3514 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3515
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3516 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3517 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3518
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3519 def Test_cindent_35()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3520 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3521 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3522 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3523
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3524 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3525 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3526 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3527 if(x==y)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3528 if(y==z)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3529 foo=1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3530 else { bar=1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3531 baz=2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3532 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3533 printf("Foo!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3534 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3535
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3536 void func1(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3537 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3538 char* tab[] = {"foo", "bar",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3539 "baz", "quux",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3540 "this line used", "to be indented incorrectly"};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3541 foo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3542 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3543
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3544 void func2(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3545 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3546 int tab[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3547 {1, 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3548 3, 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3549 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3550
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3551 printf("This line used to be indented incorrectly.\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3552 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3553
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3554 int foo[]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3555 #ifdef BAR
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3556
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3557 = { 1, 2, 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3558 4, 5, 6 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3559
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3560 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3561 ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3562 int baz;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3563
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3564 void func3(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3565 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3566 int tab[] = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3567 1, 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3568 3, 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3569 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3570
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3571 printf("Don't you dare indent this line incorrectly!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3572 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3573
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3574 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3575 func4(a, b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3576 c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3577 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3578 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3579 int c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3580 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3581 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3582
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3583 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3584 func5(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3585 int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3586 int b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3587 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3588 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3589
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3590 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3591 func6(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3592 int a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3593 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3594 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3595 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3596
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3597 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3598 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3599 normal ]]=7][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3600
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3601 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3602 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3603 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3604 if(x==y)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3605 if(y==z)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3606 foo=1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3607 else { bar=1;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3608 baz=2;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3609 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3610 printf("Foo!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3611 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3612
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3613 void func1(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3614 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3615 char* tab[] = {"foo", "bar",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3616 "baz", "quux",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3617 "this line used", "to be indented incorrectly"};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3618 foo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3619 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3620
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3621 void func2(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3622 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3623 int tab[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3624 {1, 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3625 3, 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3626 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3627
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3628 printf("This line used to be indented incorrectly.\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3629 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3630
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3631 int foo[]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3632 #ifdef BAR
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3633
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3634 = { 1, 2, 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3635 4, 5, 6 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3636
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3637 #endif
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3638 ;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3639 int baz;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3640
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3641 void func3(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3642 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3643 int tab[] = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3644 1, 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3645 3, 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3646 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3647
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3648 printf("Don't you dare indent this line incorrectly!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3649 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3650
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3651 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3652 func4(a, b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3653 c)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3654 int a;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3655 int b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3656 int c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3657 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3658 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3659
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3660 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3661 func5(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3662 int a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3663 int b)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3664 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3665 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3666
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3667 void
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3668 func6(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3669 int a)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3670 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3671 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3672
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3673 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3674 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3675
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3676 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3677 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3678
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3679 def Test_cindent_36()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3680 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3681 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3682 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3683 setl cino+=l1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3684
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3685 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3686 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3687 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3688 int tab[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3689 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3690 1, 2, 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3691 4, 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3692
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3693 printf("Indent this line correctly!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3694
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3695 switch (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3696 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3697 case bar:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3698 printf("bar");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3699 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3700 case baz: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3701 printf("baz");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3702 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3703 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3704 case quux:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3705 printf("But don't break the indentation of this instruction\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3706 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3707 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3708 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3709 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3710
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3711 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3712 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3713 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3714
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3715 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3716 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3717 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3718 int tab[] =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3719 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3720 1, 2, 3,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3721 4, 5, 6};
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3722
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3723 printf("Indent this line correctly!\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3724
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3725 switch (foo)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3726 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3727 case bar:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3728 printf("bar");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3729 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3730 case baz: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3731 printf("baz");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3732 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3733 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3734 case quux:
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3735 printf("But don't break the indentation of this instruction\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3736 break;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3737 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3738 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3739
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3740 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3741 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3742
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3743 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3744 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3745
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3746 def Test_cindent_37()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3747 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3748 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3749 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3750
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3751 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3752 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3753 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3754 cout << "a"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3755 << "b"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3756 << ") :"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3757 << "c";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3758 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3759 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3760
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3761 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3762 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3763 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3764
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3765 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3766 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3767 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3768 cout << "a"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3769 << "b"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3770 << ") :"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3771 << "c";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3772 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3773
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3774 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3775 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3776
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3777 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3778 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3779
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3780 def Test_cindent_38()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3781 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3782 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3783 setl com=s1:/*,m:*,ex:*/
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3784
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3785 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3786 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3787 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3788 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3789 * This is a comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3790 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3791 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3792 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3793
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3794 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3795 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3796 normal ]]3jofoo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3797
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3798 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3799 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3800 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3801 /*
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3802 * This is a comment.
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3803 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3804 foo();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3805 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3806
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3807 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3808 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3809
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3810 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3811 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3812
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3813 def Test_cindent_39()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3814 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3815 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3816 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3817
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3818 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3819 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3820 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3821 for (int i = 0; i < 10; ++i)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3822 if (i & 1) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3823 foo(1);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3824 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3825 foo(0);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3826 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3827 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3828 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3829
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3830 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3831 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3832 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3833
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3834 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3835 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3836 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3837 for (int i = 0; i < 10; ++i)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3838 if (i & 1) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3839 foo(1);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3840 } else
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3841 foo(0);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3842 baz();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3843 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3844
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3845 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3846 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3847
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3848 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3849 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3850
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3851 def Test_cindent_40()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3852 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3853 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3854 setl cino=k2s,(0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3855
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3856 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3857 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3858 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3859 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3860 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3861 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3862 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3863 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3864
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3865 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3866 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3867 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3868 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3869 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3870 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3871 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3872
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3873 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3874 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3875 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3876 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3877 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3878 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3879 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3880 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3881 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3882 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3883
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3884 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3885 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3886 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3887
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3888 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3889 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3890 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3891 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3892 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3893 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3894 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3895 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3896
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3897 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3898 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3899 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3900 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3901 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3902 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3903 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3904
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3905 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3906 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3907 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3908 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3909 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3910 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3911 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3912 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3913 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3914
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3915 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3916 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3917
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3918 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3919 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3920
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3921 def Test_cindent_41()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3922 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3923 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3924 setl cino=k2s,(s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3925
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3926 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3927 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3928 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3929 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3930 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3931 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3932 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3933 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3934
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3935 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3936 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3937 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3938 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3939 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3940 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3941 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3942
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3943 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3944 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3945 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3946 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3947 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3948 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3949 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3950 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3951 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3952 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3953
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3954 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3955 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3956 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3957
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3958 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3959 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3960 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3961 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3962 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3963 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3964 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3965 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3966
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3967 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3968 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3969 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3970 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3971 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3972 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3973 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3974
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3975 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3976 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3977 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3978 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3979 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3980 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3981 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3982 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3983 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3984
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3985 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3986 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3987
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3988 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3989 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3990
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3991 def Test_cindent_42()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3992 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3993 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3994 setl cino=k2s,(s,U1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3995
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
3996 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3997 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3998 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3999 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4000 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4001 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4002 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4003 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4004
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4005 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4006 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4007 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4008 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4009 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4010 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4011 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4012 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4013 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4014 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4015 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4016
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4017 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4018 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4019 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4020 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4021 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4022 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4023 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4024
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4025 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4026 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4027 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4028
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4029 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4030 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4031 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4032 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4033 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4034 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4035 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4036 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4037
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4038 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4039 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4040 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4041 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4042 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4043 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4044 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4045 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4046 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4047 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4048 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4049
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4050 c = c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4051 (
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4052 c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4053 c3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4054 ) && c4;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4055 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4056
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4057 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4058 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4059
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4060 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4061 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4062
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4063 def Test_cindent_43()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4064 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4065 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4066 setl cino=k2s,(0,W4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4067
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4068 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4069 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4070 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4071 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4072 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4073 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4074 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4075 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4076
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4077 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4078 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4079 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4080 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4081 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4082 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4083 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4084 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4085 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4086 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4087 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4088
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4089 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4090 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4091 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4092 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4093
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4094 a_long_line(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4095 argument,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4096 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4097 a_short_line(argument,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4098 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4099 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4100 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4101
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4102 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4103 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4104 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4105
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4106 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4107 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4108 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4109 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4110 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4111 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4112 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4113 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4114
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4115 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4116 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4117 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4118 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4119 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4120 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4121 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4122 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4123 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4124 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4125 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4126
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4127 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4128 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4129 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4130 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4131
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4132 a_long_line(
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4133 argument,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4134 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4135 a_short_line(argument,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4136 argument);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4137 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4138
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4139 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4140 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4141
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4142 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4143 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4144
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4145 def Test_cindent_44()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4146 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4147 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4148 setl cino=k2s,u2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4149
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4150 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4151 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4152 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4153 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4154 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4155 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4156 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4157 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4158
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4159 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4160 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4161 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4162 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4163 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4164 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4165 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4166 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4167 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4168 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4169 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4170 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4171 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4172
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4173 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4174 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4175 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4176
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4177 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4178 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4179 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4180 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4181 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4182 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4183 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4184 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4185
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4186 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4187 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4188 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4189 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4190 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4191 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4192 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4193 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4194 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4195 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4196 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4197 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4198
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4199 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4200 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4201
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4202 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4203 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4204
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4205 def Test_cindent_45()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4206 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4207 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4208 setl cino=k2s,(0,w1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4209
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4210 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4211 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4212 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4213 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4214 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4215 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4216 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4217 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4218
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4219 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4220 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4221 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4222 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4223 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4224 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4225 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4226 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4227 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4228 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4229 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4230
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4231 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4232 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4233 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4234 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4235 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4236 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4237 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4238 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4239 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4240 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4241
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4242 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4243 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4244 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4245
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4246 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4247 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4248 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4249 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4250 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4251 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4252 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4253 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4254
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4255 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4256 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4257 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4258 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4259 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4260 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4261 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4262 if (c123456789
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4263 && (c22345
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4264 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4265 printf("foo\n");
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4266
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4267 if ( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4268 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4269 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4270 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4271 func( c1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4272 && ( c2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4273 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4274 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4275 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4276
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4277 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4278 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4279
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4280 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4281 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4282
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4283 def Test_cindent_46()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4284 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4285 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4286 setl cino=k2,(s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4287
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4288 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4289 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4290 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4291 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4292 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4293 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4294 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4295 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4296
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4297 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4298 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4299 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4300 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4301 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4302 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4303 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4304 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4305 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4306
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4307 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4308 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4309 normal ]]=][
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4310
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4311 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4312 void func(void)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4313 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4314 if (condition1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4315 && condition2)
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4316 action();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4317 function(argument1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4318 && argument2);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4319
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4320 if (c1 && (c2 ||
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4321 c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4322 foo;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4323 if (c1 &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4324 (c2 || c3))
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4325 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4326 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4327 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4328
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4329 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4330 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4331
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4332 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4333 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4334
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4335 def Test_cindent_47()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4336 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4337 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4338 setl cino=N-s
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4339
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4340 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4341 NAMESPACESTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4342 /* valid namespaces with normal indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4343 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4344 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4345 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4346 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4347 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4348 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4349 namespace /* test */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4350 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4351 11111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4352 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4353 namespace // test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4354 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4355 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4356 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4357 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4358 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4359 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4360 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4361 namespace test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4362 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4363 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4364 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4365 namespace test::cpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4366 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4367 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4368 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4369 namespace ::incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4370 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4371 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4372 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4373 namespace test::incorrectcpp17::
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4374 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4375 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4376 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4377 namespace test:incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4378 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4379 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4380 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4381 namespace test:::incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4382 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4383 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4384 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4385 namespace{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4386 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4387 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4388 namespace test{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4389 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4390 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4391 namespace {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4392 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4393 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4394 namespace test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4395 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4396 namespace test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4397 22222222222222222;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4398 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4399 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4400 inline namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4401 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4402 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4403 inline /* test */ namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4404 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4405 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4406 inline/* test */namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4407 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4408 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4409
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4410 /* invalid namespaces use block indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4411 namespace test test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4412 111111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4413 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4414 namespace11111111111 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4415 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4416 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4417 namespace() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4418 1111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4419 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4420 namespace()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4421 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4422 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4423 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4424 namespace test test2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4425 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4426 1111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4427 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4428 namespace111111111
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4429 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4430 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4431 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4432 inlinenamespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4433 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4434 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4435 NAMESPACEEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4436 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4437
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4438 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4439 normal gg
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4440 call search('^NAMESPACESTART')
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4441 exe "normal =/^NAMESPACEEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4442
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4443 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4444 NAMESPACESTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4445 /* valid namespaces with normal indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4446 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4447 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4448 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4449 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4450 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4451 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4452 namespace /* test */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4453 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4454 11111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4455 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4456 namespace // test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4457 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4458 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4459 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4460 namespace
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4461 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4462 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4463 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4464 namespace test
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4465 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4466 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4467 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4468 namespace test::cpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4469 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4470 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4471 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4472 namespace ::incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4473 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4474 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4475 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4476 namespace test::incorrectcpp17::
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4477 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4478 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4479 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4480 namespace test:incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4481 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4482 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4483 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4484 namespace test:::incorrectcpp17
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4485 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4486 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4487 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4488 namespace{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4489 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4490 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4491 namespace test{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4492 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4493 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4494 namespace {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4495 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4496 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4497 namespace test {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4498 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4499 namespace test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4500 22222222222222222;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4501 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4502 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4503 inline namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4504 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4505 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4506 inline /* test */ namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4507 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4508 }
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4509 inline/* test */namespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4510 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4511 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4512
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4513 /* invalid namespaces use block indent */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4514 namespace test test2 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4515 111111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4516 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4517 namespace11111111111 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4518 111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4519 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4520 namespace() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4521 1111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4522 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4523 namespace()
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4524 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4525 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4526 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4527 namespace test test2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4528 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4529 1111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4530 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4531 namespace111111111
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4532 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4533 111111111111111111;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4534 }
26694
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4535 inlinenamespace {
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4536 111111111111111111;
1095fd0dc362 patch 8.2.3876: 'cindent' does not recognize inline namespace
Bram Moolenaar <Bram@vim.org>
parents: 26516
diff changeset
4537 }
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4538 NAMESPACEEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4539
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4540 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4541 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4542
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4543 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4544 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4545
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4546 def Test_cindent_48()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4547 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4548 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4549 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4550
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4551 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4552 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4553 var bar = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4554 foo: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4555 that: this,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4556 some: ok,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4557 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4558 "bar":{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4559 a : 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4560 b: "123abc",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4561 x: 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4562 "y": 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4563 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4564 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4565 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4566 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4567
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4568 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4569 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4570 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4571 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4572
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4573 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4574 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4575 var bar = {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4576 foo: {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4577 that: this,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4578 some: ok,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4579 },
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4580 "bar":{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4581 a : 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4582 b: "123abc",
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4583 x: 4,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4584 "y": 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4585 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4586 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4587 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4588
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4589 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4590 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4591
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4592 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4593 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4594
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4595 def Test_cindent_49()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4596 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4597 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4598 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4599
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4600 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4601 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4602 var foo = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4603 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4604 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4605 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4606 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4607 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4608 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4609
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4610 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4611 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4612 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4613 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4614
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4615 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4616 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4617 var foo = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4618 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4619 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4620 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4621 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4622 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4623
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4624 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4625 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4626
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4627 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4628 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4629
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4630 def Test_cindent_50()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4631 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4632 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4633 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4634
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4635 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4636 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4637 function bar() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4638 var foo = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4639 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4640 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4641 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4642 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4643 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4644 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4645 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4646
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4647 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4648 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4649 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4650 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4651
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4652 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4653 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4654 function bar() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4655 var foo = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4656 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4657 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4658 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4659 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4660 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4661 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4662
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4663 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4664 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4665
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4666 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4667 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4668
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4669 def Test_cindent_51()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4670 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4671 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4672 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4673
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4674 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4675 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4676 (function($){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4677
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4678 if (cond &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4679 cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4680 stmt;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4681 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4682 window.something.left =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4683 (width - 50 + offset) + "px";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4684 var class_name='myclass';
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4685
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4686 function private_method() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4687 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4688
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4689 var public_method={
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4690 method: function(options,args){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4691 private_method();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4692 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4693 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4694
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4695 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4696
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4697 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4698 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4699 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4700 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4701 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4702 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4703 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4704 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4705 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4706 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4707 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4708 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4709 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4710
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4711 $.fn[class_name]=function() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4712
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4713 var _arguments=arguments;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4714 return this.each(function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4715
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4716 var options=$(this).data(class_name+'_public');
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4717 if (!options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4718 init.apply(this,_arguments);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4719
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4720 } else {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4721 var method=public_method[_arguments[0]];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4722
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4723 if (typeof(method)!='function') {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4724 console.log(class_name+' has no method "'+_arguments[0]+'"');
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4725 return false;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4726 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4727 _arguments[0]=options;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4728 method.apply(this,_arguments);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4729 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4730 });
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4731 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4732
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4733 })(jQuery);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4734 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4735 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4736
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4737 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4738 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4739 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4740 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4741
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4742 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4743 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4744 (function($){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4745
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4746 if (cond &&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4747 cond) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4748 stmt;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4749 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4750 window.something.left =
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4751 (width - 50 + offset) + "px";
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4752 var class_name='myclass';
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4753
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4754 function private_method() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4755 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4756
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4757 var public_method={
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4758 method: function(options,args){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4759 private_method();
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4760 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4761 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4762
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4763 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4764
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4765 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4766 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4767 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4768 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4769 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4770 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4771 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4772 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4773 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4774 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4775 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4776 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4777 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4778
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4779 $.fn[class_name]=function() {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4780
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4781 var _arguments=arguments;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4782 return this.each(function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4783
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4784 var options=$(this).data(class_name+'_public');
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4785 if (!options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4786 init.apply(this,_arguments);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4787
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4788 } else {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4789 var method=public_method[_arguments[0]];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4790
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4791 if (typeof(method)!='function') {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4792 console.log(class_name+' has no method "'+_arguments[0]+'"');
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4793 return false;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4794 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4795 _arguments[0]=options;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4796 method.apply(this,_arguments);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4797 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4798 });
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4799 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4800
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4801 })(jQuery);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4802 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4803
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4804 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4805 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4806
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4807 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4808 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4809
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4810 def Test_cindent_52()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4811 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4812 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4813 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4814
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4815 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4816 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4817 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4818 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4819 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4820 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4821 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4822 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4823 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4824 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4825 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4826 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4827 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4828 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4829 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4830 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4831 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4832 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4833
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4834 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4835 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4836 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4837 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4838
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4839 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4840 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4841 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4842 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4843 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4844 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4845 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4846 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4847 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4848 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4849 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4850 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4851 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4852 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4853 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4854 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4855 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4856
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4857 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4858 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4859
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4860 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4861 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4862
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4863 def Test_cindent_53()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4864 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4865 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4866 setl cino=j1,J1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4867
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4868 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4869 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4870 (function($){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4871 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4872 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4873 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4874 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4875 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4876 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4877 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4878 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4879 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4880 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4881 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4882 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4883 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4884 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4885 })(jQuery);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4886 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4887 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4888
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4889 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4890 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4891 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4892 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4893
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4894 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4895 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4896 (function($){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4897 function init(options) {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4898 $(this).data(class_name+'_public',$.extend({},{
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4899 foo: 'bar',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4900 bar: 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4901 foobar: [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4902 1,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4903 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4904 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4905 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4906 callback: function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4907 return true;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4908 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4909 }, options||{}));
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4910 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4911 })(jQuery);
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4912 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4913
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4914 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4915 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4916
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4917 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4918 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4919
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4920 def Test_cindent_54()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4921 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4922 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4923 setl cino=j1,J1,+2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4924
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
4925 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4926 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4927 // Results of JavaScript indent
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4928 // 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4929 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4930 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4931 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4932 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4933 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4934 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4935 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4936 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4937 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4938 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4939 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4940 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4941 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4942
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4943 // 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4944 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4945 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4946 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4947 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4948 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4949 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4950 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4951 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4952 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4953 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4954 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4955 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4956 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4957 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4958 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4959 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4960 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4961 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4962 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4963
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4964 // 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4965 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4966 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4967 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4968 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4969 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4970 /* comment 2 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4971 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4972 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4973 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4974 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4975 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4976 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4977 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4978 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4979 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4980 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4981 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4982 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4983 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4984 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4985 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4986
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4987 // 4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4988 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4989 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4990 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4991 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4992 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4993 var b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4994 var c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4995 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4996
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4997 // 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4998 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4999 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5000 [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5001 0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5002 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5003 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5004 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5005 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5006 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5007
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5008 // 6
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5009 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5010 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5011 [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5012 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5013 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5014 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5015 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5016 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5017 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5018 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5019
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5020 // 7
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5021 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5022 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5023 // [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5024 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5025 // 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5026 // ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5027 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5028 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5029 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5030 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5031
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5032 // 8
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5033 var x = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5034 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5035 var a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5036 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5037 c,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5038 d,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5039 e,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5040 f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5041 g,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5042 h,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5043 i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5044 })
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5045 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5046
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5047 // 9
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5048 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5049 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5050 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5051 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5052 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5053 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5054 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5055 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5056 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5057 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5058 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5059 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5060 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5061 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5062 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5063 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5064 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5065
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5066 // 10
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5067 var a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5068 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5069 c,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5070 d,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5071 e,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5072 f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5073 g,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5074 h,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5075 i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5076 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5077 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5078
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5079 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5080 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5081 search('^JSSTART')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5082 exe "normal =/^JSEND\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5083
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5084 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5085 JSSTART
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5086 // Results of JavaScript indent
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5087 // 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5088 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5089 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5090 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5091 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5092 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5093 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5094 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5095 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5096 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5097 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5098 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5099 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5100 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5101
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5102 // 2
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5103 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5104 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5105 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5106 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5107 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5108 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5109 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5110 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5111 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5112 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5113 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5114 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5115 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5116 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5117 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5118 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5119 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5120 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5121 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5122
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5123 // 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5124 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5125 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5126 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5127 // comment 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5128 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5129 /* comment 2 */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5130 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5131 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5132 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5133 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5134 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5135 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5136 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5137 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5138 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5139 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5140 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5141 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5142 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5143 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5144 }())
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5145
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5146 // 4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5147 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5148 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5149 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5150 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5151 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5152 var b;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5153 var c;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5154 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5155
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5156 // 5
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5157 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5158 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5159 [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5160 0
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5161 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5162 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5163 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5164 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5165 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5166
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5167 // 6
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5168 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5169 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5170 [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5171 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5172 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5173 ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5174 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5175 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5176 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5177 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5178
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5179 // 7
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5180 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5181 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5182 // [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5183 0,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5184 // 1
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5185 // ],
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5186 2,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5187 3
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5188 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5189 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5190
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5191 // 8
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5192 var x = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5193 (function(){
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5194 var a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5195 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5196 c,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5197 d,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5198 e,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5199 f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5200 g,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5201 h,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5202 i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5203 })
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5204 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5205
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5206 // 9
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5207 var a = [
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5208 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5209 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5210 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5211 'a',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5212 'b',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5213 0 +
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5214 5 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5215 9 *
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5216 'c',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5217 'd',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5218 'e',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5219 'f',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5220 'g',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5221 'h',
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5222 'i'
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5223 ];
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5224
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5225 // 10
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5226 var a,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5227 b,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5228 c,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5229 d,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5230 e,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5231 f,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5232 g,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5233 h,
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5234 i;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5235 JSEND
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5236
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5237 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5238 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5239
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5240 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5241 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5242
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5243 def Test_cindent_55()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5244 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5245 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5246 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5247
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5248 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5249 /* start of define */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5250 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5251 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5252 #define AAA \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5253 BBB\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5254 CCC
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5255
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5256 #define CNT \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5257 1 + \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5258 2 + \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5259 4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5260 /* end of define */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5261 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5262
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5263 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5264 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5265 search('start of define')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5266 exe "normal =/end of define\n"
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5267
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5268 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5269 /* start of define */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5270 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5271 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5272 #define AAA \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5273 BBB\
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5274 CCC
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5275
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5276 #define CNT \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5277 1 + \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5278 2 + \
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5279 4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5280 /* end of define */
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5281
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5282 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5283 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5284
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5285 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5286 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5287
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5288 def Test_cindent_56()
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5289 new
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5290 setl cindent ts=4 sw=4
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5291 setl cino&
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5292
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5293 var code =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5294 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5295 a = second/*bug*/*line;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5296 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5297 [CODE]
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5298
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5299 append(0, code)
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5300 normal gg
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5301 search('a = second')
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5302 normal ox
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5303
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5304 var expected =<< trim [CODE]
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5305 {
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5306 a = second/*bug*/*line;
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5307 x
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5308 }
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5309
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5310 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5311 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5312
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5313 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5314 enddef
16865
d615cc95089c patch 8.1.1434: test 3 is old style
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5315
19104
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5316 " this was going beyond the end of the line.
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5317 def Test_cindent_case()
19104
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5318 new
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5319 setline(1, 'case x: // x')
19104
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5320 set cindent
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5321 norm! f:a:
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5322 assert_equal('case x:: // x', getline(1))
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 19104
diff changeset
5323 set cindent&
19104
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5324 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5325 enddef
19104
9f4648953f1a patch 8.2.0112: illegal memory access when using 'cindent'
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
5326
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
5327 " Test for changing multiple lines (using c) with cindent
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5328 def Test_cindent_change_multline()
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
5329 new
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
5330 setlocal cindent
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5331 setline(1, ['if (a)', '{', ' i = 1;', '}'])
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
5332 normal! jc3jm = 2;
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5333 assert_equal("\tm = 2;", getline(2))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5334 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5335 enddef
19613
9c15be376631 patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents: 19195
diff changeset
5336
28891
85c2bbee17d0 patch 8.2.4968: reading past end of the line when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 28353
diff changeset
5337 " This was reading past the end of the line
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5338 def Test_cindent_check_funcdecl()
28891
85c2bbee17d0 patch 8.2.4968: reading past end of the line when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 28353
diff changeset
5339 new
85c2bbee17d0 patch 8.2.4968: reading past end of the line when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 28353
diff changeset
5340 sil norm o0('\0=L
85c2bbee17d0 patch 8.2.4968: reading past end of the line when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 28353
diff changeset
5341 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5342 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5343
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5344 def Test_cindent_scopedecls()
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5345 new
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5346 setl cindent ts=4 sw=4
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5347 setl cino=g0
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5348 setl cinsd+=public\ slots,signals
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5349
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5350 var code =<< trim [CODE]
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5351 class Foo
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5352 {
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5353 public:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5354 virtual void foo() = 0;
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5355 public slots:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5356 void onBar();
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5357 signals:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5358 void baz();
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5359 private:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5360 int x;
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5361 };
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5362 [CODE]
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5363
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5364 append(0, code)
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5365 normal gg
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5366 normal ]]=][
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5367
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5368 var expected =<< trim [CODE]
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5369 class Foo
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5370 {
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5371 public:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5372 virtual void foo() = 0;
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5373 public slots:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5374 void onBar();
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5375 signals:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5376 void baz();
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5377 private:
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5378 int x;
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5379 };
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5380
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 26694
diff changeset
5381 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5382 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5383
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5384 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5385 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5386
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5387 def Test_cindent_pragma()
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5388 new
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5389 setl cindent ts=4 sw=4
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5390 setl cino=Ps
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5391
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5392 var code =<< trim [CODE]
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5393 {
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5394 #pragma omp parallel
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5395 {
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5396 #pragma omp task
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5397 foo();
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5398 # pragma omp taskwait
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5399 }
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5400 }
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5401 [CODE]
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5402
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5403 append(0, code)
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5404 normal gg
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5405 normal =G
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5406
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5407 var expected =<< trim [CODE]
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5408 {
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5409 #pragma omp parallel
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5410 {
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5411 #pragma omp task
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5412 foo();
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5413 # pragma omp taskwait
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5414 }
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5415 }
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5416
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 19613
diff changeset
5417 [CODE]
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5418 assert_equal(expected, getline(1, '$'))
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5419
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5420 bwipe!
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5421 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5422
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5423 def Test_backslash_at_end_of_line()
25897
f2fb5d30cd16 patch 8.2.3482: reading beyond end of line ending in quote and backslash
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
5424 new
f2fb5d30cd16 patch 8.2.3482: reading beyond end of line ending in quote and backslash
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
5425 exe "norm v>O'\\\<C-m>-"
f2fb5d30cd16 patch 8.2.3482: reading beyond end of line ending in quote and backslash
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
5426 exe "norm \<C-q>="
f2fb5d30cd16 patch 8.2.3482: reading beyond end of line ending in quote and backslash
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
5427 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5428 enddef
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5429
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5430 def Test_find_brace_backwards()
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5431 # this was looking beyond the end of the line
26187
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5432 new
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5433 norm R/*
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5434 norm o0{
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5435 norm o//
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5436 norm V{=
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5437 assert_equal(['/*', ' 0{', '//'], getline(1, 3))
26187
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5438 bwipe!
28944
f498ab5c82ea patch 8.2.4994: tests are using legacy functions
Bram Moolenaar <Bram@vim.org>
parents: 28891
diff changeset
5439 enddef
26187
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5440
8e92f01f7226 patch 8.2.3625: illegal memory access when C-indenting
Bram Moolenaar <Bram@vim.org>
parents: 25897
diff changeset
5441
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 11069
diff changeset
5442 " vim: shiftwidth=2 sts=2 expandtab