Mercurial > vim
annotate src/testdir/test_goto.vim @ 10646:8cff35d5f5dc v8.0.0213
patch 8.0.0213: Netbeans specialKeys command does not check argument length
commit https://github.com/vim/vim/commit/ca24e2cfcfd3f064ea1674886e3dcaa8254ad8d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 22 15:19:22 2017 +0100
patch 8.0.0213: Netbeans specialKeys command does not check argument length
Problem: The Netbeans "specialKeys" command does not check if the argument
fits in the buffer. (Coverity)
Solution: Add a length check.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 22 Jan 2017 15:30:04 +0100 |
parents | 536a7d49249c |
children | b16bc115a270 |
rev | line source |
---|---|
8925
f0d7dfb136bc
commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test commands that jump somewhere. |
f0d7dfb136bc
commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
3 " Create a new buffer using "lines" and place the cursor on the word after the |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
4 " first occurrence of return and invoke "cmd". The cursor should now be |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
5 " positioned at the given line and col. |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
6 func XTest_goto_decl(cmd, lines, line, col) |
8925
f0d7dfb136bc
commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 new |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
8 call setline(1, a:lines) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
9 /return/ |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
10 normal! W |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
11 execute 'norm! ' . a:cmd |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
12 call assert_equal(a:line, line('.')) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
13 call assert_equal(a:col, col('.')) |
8925
f0d7dfb136bc
commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 quit! |
f0d7dfb136bc
commit https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endfunc |
9315
1b4946fa3777
commit https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
Christian Brabandt <cb@256bit.org>
parents:
8925
diff
changeset
|
16 |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
17 func Test_gD() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
18 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
19 \ 'int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
20 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
21 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
22 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
23 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
24 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
25 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
26 call XTest_goto_decl('gD', lines, 1, 5) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
27 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
28 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
29 func Test_gD_too() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
30 let lines = [ |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
31 \ 'Filename x;', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
32 \ '', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
33 \ 'int Filename', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
34 \ 'int func() {', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
35 \ ' Filename x;', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
36 \ ' return x;', |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
37 \ ] |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
38 call XTest_goto_decl('gD', lines, 1, 10) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
39 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
40 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
41 func Test_gD_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
42 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
43 \ '/* int x; */', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
44 \ 'int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
45 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
46 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
47 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
48 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
49 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
50 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
51 call XTest_goto_decl('gD', lines, 2, 5) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
52 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
53 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
54 func Test_gD_inline_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
55 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
56 \ 'int y /* , x */;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
57 \ 'int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
58 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
59 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
60 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
61 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
62 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
63 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
64 call XTest_goto_decl('gD', lines, 2, 5) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
65 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
66 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
67 func Test_gD_string() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
68 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
69 \ 'char *s[] = "x";', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
70 \ 'int x = 1;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
71 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
72 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
73 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
74 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
75 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
76 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
77 call XTest_goto_decl('gD', lines, 2, 5) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
78 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
79 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
80 func Test_gD_string_same_line() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
81 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
82 \ 'char *s[] = "x", int x = 1;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
83 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
84 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
85 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
86 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
87 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
88 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
89 call XTest_goto_decl('gD', lines, 1, 22) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
90 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
91 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
92 func Test_gD_char() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
93 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
94 \ "char c = 'x';", |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
95 \ 'int x = 1;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
96 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
97 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
98 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
99 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
100 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
101 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
102 call XTest_goto_decl('gD', lines, 2, 5) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
103 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
104 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
105 func Test_gd() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
106 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
107 \ 'int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
108 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
109 \ 'int func(int x)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
110 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
111 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
112 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
113 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
114 call XTest_goto_decl('gd', lines, 3, 14) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
115 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
116 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
117 func Test_gd_not_local() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
118 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
119 \ 'int func1(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
120 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
121 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
122 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
123 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
124 \ 'int func2(int x)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
125 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
126 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
127 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
128 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
129 call XTest_goto_decl('gd', lines, 3, 10) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
130 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
131 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
132 func Test_gd_kr_style() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
133 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
134 \ 'int func(x)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
135 \ ' int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
136 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
137 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
138 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
139 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
140 call XTest_goto_decl('gd', lines, 2, 7) |
9315
1b4946fa3777
commit https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
Christian Brabandt <cb@256bit.org>
parents:
8925
diff
changeset
|
141 endfunc |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
142 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
143 func Test_gd_missing_braces() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
144 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
145 \ 'def func1(a)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
146 \ ' a + 1', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
147 \ 'end', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
148 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
149 \ 'a = 1', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
150 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
151 \ 'def func2()', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
152 \ ' return a', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
153 \ 'end', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
154 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
155 call XTest_goto_decl('gd', lines, 1, 11) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
156 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
157 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
158 func Test_gd_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
159 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
160 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
161 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
162 \ ' /* int x; */', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
163 \ ' int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
164 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
165 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
166 \] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
167 call XTest_goto_decl('gd', lines, 4, 7) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
168 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
169 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
170 func Test_gd_comment_in_string() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
171 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
172 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
173 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
174 \ ' char *s ="//"; int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
175 \ ' int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
176 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
177 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
178 \] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
179 call XTest_goto_decl('gd', lines, 3, 22) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
180 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
181 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
182 func Test_gd_string_in_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
183 set comments= |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
184 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
185 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
186 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
187 \ ' /* " */ int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
188 \ ' int x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
189 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
190 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
191 \] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
192 call XTest_goto_decl('gd', lines, 3, 15) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
193 set comments& |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
194 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
195 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
196 func Test_gd_inline_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
197 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
198 \ 'int func(/* x is an int */ int x)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
199 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
200 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
201 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
202 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
203 call XTest_goto_decl('gd', lines, 1, 32) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
204 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
205 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
206 func Test_gd_inline_comment_only() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
207 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
208 \ 'int func(void) /* one lonely x */', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
209 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
210 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
211 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
212 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
213 call XTest_goto_decl('gd', lines, 3, 10) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
214 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
215 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
216 func Test_gd_inline_comment_body() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
217 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
218 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
219 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
220 \ ' int y /* , x */;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
221 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
222 \ ' for (/* int x = 0 */; y < 2; y++);', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
223 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
224 \ ' int x = 0;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
225 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
226 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
227 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
228 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
229 call XTest_goto_decl('gd', lines, 7, 7) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
230 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
231 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
232 func Test_gd_trailing_multiline_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
233 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
234 \ 'int func(int x) /* x is an int */', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
235 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
236 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
237 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
238 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
239 call XTest_goto_decl('gd', lines, 1, 14) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
240 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
241 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
242 func Test_gd_trailing_comment() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
243 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
244 \ 'int func(int x) // x is an int', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
245 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
246 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
247 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
248 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
249 call XTest_goto_decl('gd', lines, 1, 14) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
250 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
251 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
252 func Test_gd_string() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
253 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
254 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
255 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
256 \ ' char *s = "x";', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
257 \ ' int x = 1;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
258 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
259 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
260 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
261 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
262 call XTest_goto_decl('gd', lines, 4, 7) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
263 endfunc |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
264 |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
265 func Test_gd_string_only() |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
266 let lines = [ |
10255
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
267 \ 'int func(void)', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
268 \ '{', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
269 \ ' char *s = "x";', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
270 \ '', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
271 \ ' return x;', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
272 \ '}', |
b2c1b7acf92a
commit https://github.com/vim/vim/commit/936c48f8ca82a0257640c8c9d0792538f5a7e813
Christian Brabandt <cb@256bit.org>
parents:
10251
diff
changeset
|
273 \ ] |
10251
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
274 call XTest_goto_decl('gd', lines, 5, 10) |
bc442c2296a7
commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents:
9315
diff
changeset
|
275 endfunc |
10456
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
276 |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
277 " Check that setting 'cursorline' does not change curswant |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
278 func Test_cursorline_keep_col() |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
279 new |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
280 call setline(1, ['long long long line', 'short line']) |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
281 normal ggfi |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
282 let pos = getcurpos() |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
283 normal j |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
284 set cursorline |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
285 normal k |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
286 call assert_equal(pos, getcurpos()) |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
287 bwipe! |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
288 set nocursorline |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
289 endfunc |
536a7d49249c
commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents:
10255
diff
changeset
|
290 |