Mercurial > vim
annotate src/testdir/test29.in @ 5026:aa1ebdf70483
Added tag v7-3-1256 for changeset 322441058afc
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 28 Jun 2013 20:16:55 +0200 |
parents | 297771eff080 |
children | 81c26975e8f9 |
rev | line source |
---|---|
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
1 Test for joining lines and marks in them |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
2 in compatible and nocompatible modes |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
3 and with 'joinspaces' set or not |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
4 and with 'cpoptions' flag 'j' set or not |
7 | 5 |
6 STARTTEST | |
3562 | 7 :so small.vim |
2456
2876ac15b8c8
Avoid that running tests changes viminfo.
Bram Moolenaar <bram@vim.org>
parents:
2291
diff
changeset
|
8 :set nocompatible viminfo+=nviminfo |
7 | 9 :set nojoinspaces |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
10 :set cpoptions-=j |
7 | 11 /firstline/ |
3562 | 12 j"td/^STARTTEST/-1 |
13 PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j | |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
14 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
15 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
16 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible |
3562 | 17 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2 |
7 | 18 ENDTEST |
19 | |
20 firstline | |
21 asdfasdf. | |
22 asdf | |
23 asdfasdf. | |
24 asdf | |
25 asdfasdf. | |
26 asdf | |
27 asdfasdf. | |
28 asdf | |
29 asdfasdf. | |
30 asdf | |
31 asdfasdf. | |
32 asdf | |
33 asdfasdf. | |
34 asdf | |
35 asdfasdf | |
36 asdf | |
37 asdfasdf | |
38 asdf | |
39 asdfasdf | |
40 asdf | |
41 asdfasdf | |
42 asdf | |
43 asdfasdf | |
44 asdf | |
45 asdfasdf | |
46 asdf | |
47 asdfasdf | |
48 asdf | |
2291
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
49 zx cvn. |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
50 as dfg? |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
51 hjkl iop! |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
52 ert |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
53 zx cvn. |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
54 as dfg? |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
55 hjkl iop! |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
56 ert |
f412e141c821
Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
57 |
3562 | 58 STARTTEST |
59 /^{/+1 | |
60 :set comments=s1:/*,mb:*,ex:*/,:// | |
61 :set nojoinspaces fo=j | |
62 :set backspace=eol,start | |
63 :.,+3join | |
64 j4J | |
65 :.,+2join | |
66 j3J | |
67 :.,+2join | |
68 j3J | |
69 :.,+2join | |
70 jj3J | |
71 ENDTEST | |
72 | |
73 { | |
74 | |
75 /* | |
76 * Make sure the previous comment leader is not removed. | |
77 */ | |
78 | |
79 /* | |
80 * Make sure the previous comment leader is not removed. | |
81 */ | |
82 | |
83 // Should the next comment leader be left alone? | |
84 // Yes. | |
85 | |
86 // Should the next comment leader be left alone? | |
87 // Yes. | |
88 | |
89 /* Here the comment leader should be left intact. */ | |
90 // And so should this one. | |
91 | |
92 /* Here the comment leader should be left intact. */ | |
93 // And so should this one. | |
94 | |
95 if (condition) // Remove the next comment leader! | |
96 // OK, I will. | |
97 action(); | |
98 | |
99 if (condition) // Remove the next comment leader! | |
100 // OK, I will. | |
101 action(); | |
102 } | |
103 | |
104 STARTTEST | |
105 /^{/+1 | |
3580 | 106 :set comments=sO:*\ -,mO:*\ \ ,exO:*/ |
107 :set comments+=s1:/*,mb:*,ex:*/,:// | |
3562 | 108 :set comments+=s1:>#,mb:#,ex:#<,:< |
109 :set cpoptions-=j joinspaces fo=j | |
110 :set backspace=eol,start | |
111 :.,+3join | |
112 j4J | |
3580 | 113 :.,+8join |
114 j9J | |
3562 | 115 :.,+2join |
116 j3J | |
117 :.,+2join | |
118 j3J | |
119 :.,+2join | |
120 jj3J | |
121 j:.,+2join | |
122 jj3J | |
123 j:.,+5join | |
124 j6J | |
125 oSome code! // Make sure backspacing does not remove this comment leader.0i | |
126 ENDTEST | |
127 | |
128 { | |
129 | |
130 /* | |
131 * Make sure the previous comment leader is not removed. | |
132 */ | |
133 | |
134 /* | |
135 * Make sure the previous comment leader is not removed. | |
136 */ | |
137 | |
3580 | 138 /* List: |
139 * - item1 | |
140 * foo bar baz | |
141 * foo bar baz | |
142 * - item2 | |
143 * foo bar baz | |
144 * foo bar baz | |
145 */ | |
146 | |
147 /* List: | |
148 * - item1 | |
149 * foo bar baz | |
150 * foo bar baz | |
151 * - item2 | |
152 * foo bar baz | |
153 * foo bar baz | |
154 */ | |
155 | |
3562 | 156 // Should the next comment leader be left alone? |
157 // Yes. | |
158 | |
159 // Should the next comment leader be left alone? | |
160 // Yes. | |
161 | |
162 /* Here the comment leader should be left intact. */ | |
163 // And so should this one. | |
164 | |
165 /* Here the comment leader should be left intact. */ | |
166 // And so should this one. | |
167 | |
168 if (condition) // Remove the next comment leader! | |
169 // OK, I will. | |
170 action(); | |
171 | |
172 if (condition) // Remove the next comment leader! | |
173 // OK, I will. | |
174 action(); | |
175 | |
176 int i = 7 /* foo *// 3 | |
177 // comment | |
178 ; | |
179 | |
180 int i = 7 /* foo *// 3 | |
181 // comment | |
182 ; | |
183 | |
184 ># Note that the last character of the ending comment leader (left angle | |
185 # bracket) is a comment leader itself. Make sure that this comment leader is | |
186 # not removed from the next line #< | |
187 < On this line a new comment is opened which spans 2 lines. This comment should | |
188 < retain its comment leader. | |
189 | |
190 ># Note that the last character of the ending comment leader (left angle | |
191 # bracket) is a comment leader itself. Make sure that this comment leader is | |
192 # not removed from the next line #< | |
193 < On this line a new comment is opened which spans 2 lines. This comment should | |
194 < retain its comment leader. | |
195 | |
196 } | |
197 | |
198 STARTTEST | |
199 :g/^STARTTEST/.,/^ENDTEST/d | |
200 :?firstline?+1,$w! test.out | |
201 :qa! | |
202 ENDTEST |