Mercurial > vim
annotate src/testdir/test29.in @ 7870:fb5ba6fbc843 v7.4.1232
commit https://github.com/vim/vim/commit/1357caf31f3e447d99baf8dd6a3243e2ab38567f
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 1 21:40:14 2016 +0100
patch 7.4.1232
Problem: Compiler warnings when the Sniff feature is enabled.
Solution: Add UNUSED.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 01 Feb 2016 21:45:06 +0100 |
parents | bc269cf15ccd |
children | ae45d497868f |
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 | |
5852 | 105 :" Test with backspace set to the non-compatible setting |
106 /^\d\+ this | |
107 :set cp bs=2 | |
108 Avim1 | |
109 Avim2u | |
110 :set cpo-=< | |
111 :inoremap <c-u> <left><c-u> | |
112 Avim3 | |
113 :iunmap <c-u> | |
114 Avim4 | |
115 :" Test with backspace set to the compatible setting | |
7003 | 116 :set backspace= visualbell |
5852 | 117 A vim5A |
118 A vim6Azweiu | |
119 :inoremap <c-u> <left><c-u> | |
120 A vim7 | |
7003 | 121 :set compatible novisualbell |
5852 | 122 ENDTEST |
123 1 this shouldn't be deleted | |
124 2 this shouldn't be deleted | |
125 3 this shouldn't be deleted | |
126 4 this should be deleted | |
127 5 this shouldn't be deleted | |
128 6 this shouldn't be deleted | |
129 7 this shouldn't be deleted | |
130 8 this shouldn't be deleted (not touched yet) | |
131 | |
132 STARTTEST | |
3562 | 133 /^{/+1 |
3580 | 134 :set comments=sO:*\ -,mO:*\ \ ,exO:*/ |
135 :set comments+=s1:/*,mb:*,ex:*/,:// | |
3562 | 136 :set comments+=s1:>#,mb:#,ex:#<,:< |
137 :set cpoptions-=j joinspaces fo=j | |
138 :set backspace=eol,start | |
139 :.,+3join | |
140 j4J | |
3580 | 141 :.,+8join |
142 j9J | |
3562 | 143 :.,+2join |
144 j3J | |
145 :.,+2join | |
146 j3J | |
147 :.,+2join | |
148 jj3J | |
149 j:.,+2join | |
150 jj3J | |
151 j:.,+5join | |
152 j6J | |
153 oSome code! // Make sure backspacing does not remove this comment leader.0i | |
154 ENDTEST | |
155 | |
156 { | |
157 | |
158 /* | |
159 * Make sure the previous comment leader is not removed. | |
160 */ | |
161 | |
162 /* | |
163 * Make sure the previous comment leader is not removed. | |
164 */ | |
165 | |
3580 | 166 /* List: |
167 * - item1 | |
168 * foo bar baz | |
169 * foo bar baz | |
170 * - item2 | |
171 * foo bar baz | |
172 * foo bar baz | |
173 */ | |
174 | |
175 /* List: | |
176 * - item1 | |
177 * foo bar baz | |
178 * foo bar baz | |
179 * - item2 | |
180 * foo bar baz | |
181 * foo bar baz | |
182 */ | |
183 | |
3562 | 184 // Should the next comment leader be left alone? |
185 // Yes. | |
186 | |
187 // Should the next comment leader be left alone? | |
188 // Yes. | |
189 | |
190 /* Here the comment leader should be left intact. */ | |
191 // And so should this one. | |
192 | |
193 /* Here the comment leader should be left intact. */ | |
194 // And so should this one. | |
195 | |
196 if (condition) // Remove the next comment leader! | |
197 // OK, I will. | |
198 action(); | |
199 | |
200 if (condition) // Remove the next comment leader! | |
201 // OK, I will. | |
202 action(); | |
203 | |
204 int i = 7 /* foo *// 3 | |
205 // comment | |
206 ; | |
207 | |
208 int i = 7 /* foo *// 3 | |
209 // comment | |
210 ; | |
211 | |
212 ># Note that the last character of the ending comment leader (left angle | |
213 # bracket) is a comment leader itself. Make sure that this comment leader is | |
214 # not removed from the next line #< | |
215 < On this line a new comment is opened which spans 2 lines. This comment should | |
216 < retain its comment leader. | |
217 | |
218 ># Note that the last character of the ending comment leader (left angle | |
219 # bracket) is a comment leader itself. Make sure that this comment leader is | |
220 # not removed from the next line #< | |
221 < On this line a new comment is opened which spans 2 lines. This comment should | |
222 < retain its comment leader. | |
223 | |
224 } | |
225 | |
226 STARTTEST | |
227 :g/^STARTTEST/.,/^ENDTEST/d | |
228 :?firstline?+1,$w! test.out | |
229 :qa! | |
230 ENDTEST |