annotate src/testdir/test_goto.vim @ 16720:9c90cf08cfa8 v8.1.1362

patch 8.1.1362: code and data in tests can be hard to read commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 20 22:12:34 2019 +0200 patch 8.1.1362: code and data in tests can be hard to read Problem: Code and data in tests can be hard to read. Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 May 2019 22:15:06 +0200
parents a04738ab7670
children 6990c1160ea5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
18 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
19 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
20
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
21 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
22 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
23 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
24 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
25 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
26
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
27 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
28 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
29
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
30 func Test_gD_too()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
31 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
32 Filename x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
33
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
34 int Filename
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
35 int func() {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
36 Filename x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
37 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
38 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
39
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
40 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
41 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
42
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
43 func Test_gD_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
44 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
45 /* int x; */
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
46 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
47
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
48 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
49 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
50 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
51 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
52 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
53
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
54 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
55 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
56
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
57 func Test_gD_inline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
58 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
59 int y /* , x */;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
60 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
61
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
62 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
63 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
64 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
65 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
66 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
67
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
68 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
69 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
70
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
71 func Test_gD_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
72 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
73 char *s[] = "x";
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
74 int x = 1;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
75
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
76 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
77 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
78 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
79 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
80 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
81
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
82 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
83 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
84
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
85 func Test_gD_string_same_line()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
86 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
87 char *s[] = "x", int x = 1;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
88
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
89 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
90 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
91 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
92 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
93 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
94
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
95 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
96 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
97
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
98 func Test_gD_char()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
99 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
100 char c = 'x';
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
101 int x = 1;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
102
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
103 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
104 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
105 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
106 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
107 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
108
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
109 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
110 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
111
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
112 func Test_gd()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
113 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
114 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
115
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
116 int func(int x)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
117 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
118 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
119 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
120 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
121
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
122 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
123 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
124
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
125 func Test_gd_not_local()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
126 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
127 int func1(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
128 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
129 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
130 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
131
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
132 int func2(int x)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
133 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
134 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
135 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
136 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
137
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
138 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
139 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
140
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
141 func Test_gd_kr_style()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
142 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
143 int func(x)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
144 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
145 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
146 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
147 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
148 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
149
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
150 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
151 endfunc
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
152
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
153 func Test_gd_missing_braces()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
154 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
155 def func1(a)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
156 a + 1
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
157 end
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
158
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
159 a = 1
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
160
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
161 def func2()
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
162 return a
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
163 end
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
164 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
165
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
166 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
167 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
168
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
169 func Test_gd_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
170 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
171 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
172 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
173 /* int x; */
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
174 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
175 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
176 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
177 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
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, 4, 7)
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_comment_in_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
183 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
184 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
185 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
186 char *s ="//"; int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
187 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
188 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
189 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
190 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
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, 22)
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
193 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
194
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
195 func Test_gd_string_in_comment()
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
196 set comments=
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
197 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
198 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
199 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
200 /* " */ int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
201 int x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
202 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
203 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
204 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
205
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
206 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
207 set comments&
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
208 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
209
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
210 func Test_gd_inline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
211 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
212 int func(/* x is an int */ int x)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
213 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
214 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
215 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
216 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
217
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
218 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
219 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
220
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
221 func Test_gd_inline_comment_only()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
222 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
223 int func(void) /* one lonely x */
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
224 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
225 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
226 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
227 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
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, 3, 10)
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_inline_comment_body()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
233 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
234 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
235 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
236 int y /* , x */;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
237
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
238 for (/* int x = 0 */; y < 2; y++);
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
239
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
240 int x = 0;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
241
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
242 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
243 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
244 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
245
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
246 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
247 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
248
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
249 func Test_gd_trailing_multiline_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
250 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
251 int func(int x) /* x is an int */
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
252 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
253 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
254 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
255 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
256
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
257 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
258 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
259
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
260 func Test_gd_trailing_comment()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
261 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
262 int func(int x) // x is an int
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
263 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
264 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
265 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
266 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
267
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
268 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
269 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
270
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
271 func Test_gd_string()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
272 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
273 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
274 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
275 char *s = "x";
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
276 int x = 1;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
277
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
278 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
279 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
280 [CODE]
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
281 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
282 endfunc
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
283
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
284 func Test_gd_string_only()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
285 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
286 int func(void)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
287 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
288 char *s = "x";
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
289
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
290 return x;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
291 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
292 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
293
10251
bc442c2296a7 commit https://github.com/vim/vim/commit/226630a030c0d41145e1109f09633360fc9c999d
Christian Brabandt <cb@256bit.org>
parents: 9315
diff changeset
294 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
295 endfunc
10456
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
296
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
297 " 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
298 func Test_cursorline_keep_col()
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
299 new
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
300 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
301 normal ggfi
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
302 let pos = getcurpos()
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
303 normal j
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
304 set cursorline
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
305 normal k
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
306 call assert_equal(pos, getcurpos())
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
307 bwipe!
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
308 set nocursorline
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
309 endfunc
536a7d49249c commit https://github.com/vim/vim/commit/a2477fd3490c1166522631eee53c57d34321086a
Christian Brabandt <cb@256bit.org>
parents: 10255
diff changeset
310
11366
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
311 func Test_gd_local_block()
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
312 let lines =<< trim [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
313 int main()
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
314 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
315 char *a = "NOT NULL";
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
316 if(a)
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
317 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
318 char *b = a;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
319 printf("%s\n", b);
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
320 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
321 else
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
322 {
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
323 char *b = "NULL";
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
324 return b;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
325 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
326
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
327 return 0;
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
328 }
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
329 [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 14013
diff changeset
330
11366
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
331 call XTest_goto_decl('1gd', lines, 11, 11)
b16bc115a270 patch 8.0.0568: 1gd may hang
Christian Brabandt <cb@256bit.org>
parents: 10456
diff changeset
332 endfunc
14013
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
333
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
334 func Test_motion_if_elif_else_endif()
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
335 new
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
336 a
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
337 /* Test pressing % on #if, #else #elsif and #endif,
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
338 * with nested #if
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
339 */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
340 #if FOO
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
341 /* ... */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
342 # if BAR
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
343 /* ... */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
344 # endif
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
345 #elif BAR
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
346 /* ... */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
347 #else
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
348 /* ... */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
349 #endif
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
350 .
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
351 /#if FOO
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
352 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
353 call assert_equal([9, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
354 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
355 call assert_equal([11, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
356 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
357 call assert_equal([13, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
358 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
359 call assert_equal([4, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
360 /# if BAR
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
361 norm $%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
362 call assert_equal([8, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
363 norm $%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
364 call assert_equal([6, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
365
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
366 bw!
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
367 endfunc
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
368
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
369 func Test_motion_c_comment()
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
370 new
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
371 a
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
372 /*
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
373 * Test pressing % on beginning/end
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
374 * of C comments.
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
375 */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
376 /* Another comment */
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
377 .
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
378 norm gg0%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
379 call assert_equal([4, 3], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
380 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
381 call assert_equal([1, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
382 norm gg0l%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
383 call assert_equal([4, 3], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
384 norm h%
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
385 call assert_equal([1, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
386
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
387 norm G^
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
388 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
389 call assert_equal([5, 21], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
390 norm %
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
391 call assert_equal([5, 1], getpos('.')[1:2])
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
392
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
393 bw!
a04738ab7670 patch 8.1.0024: % command not testded on #ifdef and comment
Christian Brabandt <cb@256bit.org>
parents: 11366
diff changeset
394 endfunc