Mercurial > vim
comparison src/testdir/test_increment.in @ 6891:f9876721bedc v7.4.765
patch 7.4.765
Problem: CTRL-A and CTRL-X in Visual mode do not always work well.
Solution: Improvements for increment and decrement. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 03 Jul 2015 12:44:07 +0200 |
parents | 9d41289b5512 |
children | 58d9f967ae1a |
comparison
equal
deleted
inserted
replaced
6890:99fc18dc1ede | 6891:f9876721bedc |
---|---|
4 ========== | 4 ========== |
5 | 5 |
6 1) Ctrl-A on visually selected number | 6 1) Ctrl-A on visually selected number |
7 Text: | 7 Text: |
8 foobar-10 | 8 foobar-10 |
9 Expected: | |
9 1) Ctrl-A on start of line: | 10 1) Ctrl-A on start of line: |
10 foobar-9 | 11 foobar-9 |
11 2) Ctrl-A on visually selected "-10": | 12 2) Ctrl-A on visually selected "-10": |
12 foobar-9 | 13 foobar-9 |
13 3) Ctrl-A on visually selected "10": | 14 3) Ctrl-A on visually selected "10": |
22 10 | 23 10 |
23 20 | 24 20 |
24 30 | 25 30 |
25 40 | 26 40 |
26 | 27 |
28 Expected: | |
27 1) Ctrl-A on visually selected lines: | 29 1) Ctrl-A on visually selected lines: |
28 11 | 30 11 |
29 21 | 31 21 |
30 31 | 32 31 |
31 41 | 33 41 |
44 | 46 |
45 30 | 47 30 |
46 | 48 |
47 40 | 49 40 |
48 | 50 |
51 Expected: | |
49 1) 2 g Ctrl-A on visually selected lines: | 52 1) 2 g Ctrl-A on visually selected lines: |
50 12 | 53 12 |
51 | 54 |
52 24 | 55 24 |
53 | 56 |
64 32 | 67 32 |
65 | 68 |
66 4) Ctrl-A on non-number | 69 4) Ctrl-A on non-number |
67 Text: | 70 Text: |
68 foobar-10 | 71 foobar-10 |
72 Expected: | |
69 1) visually select foobar: | 73 1) visually select foobar: |
70 foobar-10 | 74 foobar-10 |
75 | |
76 5) g<Ctrl-A> on letter | |
77 Test: | |
78 a | |
79 a | |
80 a | |
81 a | |
82 Expected: | |
83 1) g Ctrl-A on visually selected lines | |
84 b | |
85 c | |
86 d | |
87 e | |
88 | |
89 6) g<Ctrl-A> on letter | |
90 Test: | |
91 z | |
92 z | |
93 z | |
94 z | |
95 Expected: | |
96 1) g Ctrl-X on visually selected lines | |
97 y | |
98 x | |
99 w | |
100 v | |
101 | |
102 7) <Ctrl-A> on letter | |
103 Test: | |
104 2 | |
105 1 | |
106 0 | |
107 -1 | |
108 -2 | |
109 | |
110 Expected: | |
111 1) Ctrl-A on visually selected lines | |
112 3 | |
113 2 | |
114 1 | |
115 0 | |
116 -1 | |
117 | |
118 2) Ctrl-X on visually selected lines | |
119 1 | |
120 0 | |
121 -1 | |
122 -2 | |
123 -3 | |
124 8) Block increment on 0x9 | |
125 Text: | |
126 0x9 | |
127 0x9 | |
128 Expected: | |
129 1) Ctrl-A on visually block selected region (cursor at beginning): | |
130 0xa | |
131 0xa | |
132 2) Ctrl-A on visually block selected region (cursor at end) | |
133 0xa | |
134 0xa | |
135 | |
136 9) Increment and redo | |
137 Text: | |
138 2 | |
139 2 | |
140 | |
141 3 | |
142 3 | |
143 | |
144 Expected: | |
145 1) 2 Ctrl-A on first 2 visually selected lines | |
146 4 | |
147 4 | |
148 2) redo (.) on 3 | |
149 5 | |
150 5 | |
151 10) sequentially decrement 1 | |
152 Text: | |
153 1 | |
154 1 | |
155 1 | |
156 1 | |
157 Expected: | |
158 1) g Ctrl-X on visually selected lines | |
159 0 | |
160 -1 | |
161 -2 | |
162 -3 | |
163 | |
164 11) visually block selected indented lines | |
165 Text: | |
166 1 | |
167 1 | |
168 1 | |
169 1 | |
170 Expexted: | |
171 1) g Ctrl-A on block selected indented lines | |
172 2 | |
173 1 | |
174 3 | |
175 4 | |
176 | |
177 12) visually selected several columns | |
178 Text: | |
179 0 0 | |
180 0 0 | |
181 0 0 | |
182 Expected: | |
183 1) 'v' select last zero and first zeroes | |
184 0 1 | |
185 1 0 | |
186 1 0 | |
71 | 187 |
72 STARTTEST | 188 STARTTEST |
73 :so small.vim | 189 :so small.vim |
74 :" | 190 :" |
75 :" Avoid CTRL-X being mapped in Visual mode for MS-Windows | 191 :" Avoid CTRL-X being mapped in Visual mode for MS-Windows |
76 :vmapclear | 192 :vmapclear |
77 :" | 193 :" |
78 :" Test 1 | 194 :" Test 1 |
79 :/^S1=/+,/^E1=/-y a | 195 :/^S1=/+,/^E1=/-y a |
80 :/^E1/+put a | 196 :/^E1=/+put a |
81 :/^E1/+2put a | 197 :/^E1=/+2put a |
82 f-v$:/^E1/+3put a | 198 f-v$:/^E1=/+3put a |
83 f1v$:/^E1/+4put a | 199 f1v$:/^E1=/+4put a |
84 f-v$:/^E1/+5put a | 200 f-v$:/^E1=/+5put a |
85 f1v$ | 201 f1v$ |
86 | 202 |
87 :" Test 22 | 203 :" Test 22 |
88 :/^S2=/+,/^E2=/-y a | 204 :/^S2=/+,/^E2=/-y a |
89 :/^E2/+put a | 205 :/^E2=/+put a |
90 V3k$:.+put a | 206 V3k$:.+put a |
91 V3k$ | 207 V3k$ |
92 | 208 |
93 :" Test 3 | 209 :" Test 3 |
94 :/^S3=/+,/^E3=/-y a | 210 :/^S3=/+,/^E3=/-y a |
98 | 214 |
99 :" Test 4 | 215 :" Test 4 |
100 :/^S4=/+,/^E4=/-y a | 216 :/^S4=/+,/^E4=/-y a |
101 :/^E4=/+put a | 217 :/^E4=/+put a |
102 vf- | 218 vf- |
219 | |
220 :" Test 5 | |
221 :set nrformats+=alpha | |
222 :/^S5=/+,/^E5=/-y a | |
223 :/^E5=/+put a | |
224 v3kg | |
225 | |
226 :" Test 6 | |
227 :/^S6=/+,/^E6=/-y a | |
228 :/^E6=/+put a | |
229 v3kg | |
230 | |
231 :" Test 7 | |
232 :/^S7=/+,/^E7=/-y a | |
233 :/^E7=/+put a | |
234 V4k:.+put a | |
235 V4k | |
236 | |
237 :" Test 8 | |
238 :/^S8=/+,/^E8=/-y a | |
239 :/^E8=/+put a | |
240 kj$:.+put a | |
241 k$+ | |
242 | |
243 :" Test 9 | |
244 :/^S9=/+,/^E9=/-y a | |
245 :/^E9=/+put a | |
246 5kVj22j. | |
247 | |
248 :" Test 10 | |
249 :/^S10=/+,/^E10=/-y a | |
250 :/^E10=/+put a | |
251 V3kg | |
252 | |
253 : Test 11 | |
254 :/^S11=/+,/^E11=/-y a | |
255 :/^E11=/+put a | |
256 3kf13jg | |
257 | |
258 :" Test 12 | |
259 :/^S12=/+,/^E12=/-y a | |
260 :/^E12=/+put a | |
261 2k$v++ | |
103 | 262 |
104 :" Save the report | 263 :" Save the report |
105 :/^# Test 1/,$w! test.out | 264 :/^# Test 1/,$w! test.out |
106 :qa! | 265 :qa! |
107 | 266 |
140 S4===== | 299 S4===== |
141 foobar-10 | 300 foobar-10 |
142 E4===== | 301 E4===== |
143 | 302 |
144 | 303 |
304 | |
305 # Test 5 | |
306 S5==== | |
307 a | |
308 a | |
309 a | |
310 a | |
311 E5==== | |
312 | |
313 | |
314 # Test 6 | |
315 S6==== | |
316 z | |
317 z | |
318 z | |
319 z | |
320 E6==== | |
321 | |
322 | |
323 | |
324 # Test 7 | |
325 S7==== | |
326 2 | |
327 1 | |
328 0 | |
329 -1 | |
330 -2 | |
331 E7==== | |
332 | |
333 | |
334 | |
335 # Test 8 | |
336 S8==== | |
337 0x9 | |
338 0x9 | |
339 E8==== | |
340 | |
341 | |
342 | |
343 | |
344 # Test 9 | |
345 S9==== | |
346 2 | |
347 2 | |
348 | |
349 3 | |
350 3 | |
351 | |
352 E9==== | |
353 | |
354 | |
355 | |
356 | |
357 # Test 10 | |
358 S10==== | |
359 1 | |
360 1 | |
361 1 | |
362 1 | |
363 E10==== | |
364 | |
365 | |
366 | |
367 | |
368 # Test 11 | |
369 S11==== | |
370 1 | |
371 1 | |
372 1 | |
373 1 | |
374 E11==== | |
375 | |
376 | |
377 | |
378 # Test 12 | |
379 S12==== | |
380 0 0 | |
381 0 0 | |
382 0 0 | |
383 E12==== | |
384 | |
385 | |
386 | |
387 | |
388 | |
389 | |
390 | |
391 | |
145 ENDTEST | 392 ENDTEST |
146 | 393 |