Mercurial > vim
annotate src/testdir/test3.in @ 11069:814126a34c9d v8.0.0423
patch 8.0.0423: changing 'cinoptions' does not always work
commit https://github.com/vim/vim/commit/6b64394f346594404cffb9591d71ac693040679f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 5 19:44:06 2017 +0100
patch 8.0.0423: changing 'cinoptions' does not always work
Problem: The effect of adding "#" to 'cinoptions' is not always removed.
(David Briscoe)
Solution: Reset b_ind_hash_comment. (Christian Brabandt, closes #1475)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 05 Mar 2017 19:45:04 +0100 |
parents | 09bb1836cdb5 |
children | 4618af3049fe |
rev | line source |
---|---|
7 | 1 /* vim: set cin ts=4 sw=4 : */ |
2 | |
11069
814126a34c9d
patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
10516
diff
changeset
|
3 Test for 'cindent'. |
814126a34c9d
patch 8.0.0423: changing 'cinoptions' does not always work
Christian Brabandt <cb@256bit.org>
parents:
10516
diff
changeset
|
4 For new tests, consider putting them in test_cindent.vim. |
7 | 5 |
6 STARTTEST | |
7 :so small.vim | |
1624 | 8 :set nocompatible viminfo+=nviminfo modeline |
7 | 9 :edit " read modeline |
10 /start of AUTO | |
11 =/end of AUTO | |
12 ENDTEST | |
13 | |
829 | 14 /* start of AUTO matically checked vim: set ts=4 : */ |
7 | 15 { |
16 if (test) | |
17 cmd1; | |
18 cmd2; | |
19 } | |
20 | |
21 { | |
22 if (test) | |
23 cmd1; | |
24 else | |
25 cmd2; | |
26 } | |
27 | |
28 { | |
29 if (test) | |
30 { | |
31 cmd1; | |
32 cmd2; | |
33 } | |
34 } | |
35 | |
36 { | |
37 if (test) | |
38 { | |
39 cmd1; | |
40 else | |
41 } | |
42 } | |
43 | |
44 { | |
45 while (this) | |
46 if (test) | |
47 cmd1; | |
48 cmd2; | |
49 } | |
50 | |
51 { | |
52 while (this) | |
53 if (test) | |
54 cmd1; | |
55 else | |
56 cmd2; | |
57 } | |
58 | |
59 { | |
60 if (test) | |
61 { | |
62 cmd; | |
63 } | |
64 | |
65 if (test) | |
66 cmd; | |
67 } | |
68 | |
69 { | |
70 if (test) { | |
71 cmd; | |
72 } | |
73 | |
74 if (test) cmd; | |
75 } | |
76 | |
77 { | |
78 cmd1; | |
79 for (blah) | |
80 while (this) | |
81 if (test) | |
82 cmd2; | |
83 cmd3; | |
84 } | |
85 | |
86 { | |
87 cmd1; | |
88 for (blah) | |
89 while (this) | |
90 if (test) | |
91 cmd2; | |
92 cmd3; | |
93 | |
94 if (test) | |
95 { | |
96 cmd1; | |
97 cmd2; | |
98 cmd3; | |
99 } | |
100 } | |
101 | |
102 | |
103 /* Test for 'cindent' do/while mixed with if/else: */ | |
104 | |
105 { | |
106 do | |
107 if (asdf) | |
108 asdfasd; | |
109 while (cond); | |
110 | |
111 do | |
112 if (asdf) | |
113 while (asdf) | |
114 asdf; | |
115 while (asdf); | |
116 } | |
117 | |
118 /* Test for 'cindent' with two ) on a continuation line */ | |
119 { | |
120 if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d | |
121 aal;sdkjf ( ;asldfkja;sldfk | |
122 al;sdjfka ;slkdf ) sa;ldkjfsa dlk;) | |
123 line up here; | |
124 } | |
125 | |
126 | |
127 /* C++ tests: */ | |
128 | |
129 // foo() these three lines should remain in column 0 | |
130 // { | |
131 // } | |
132 | |
133 /* Test for continuation and unterminated lines: */ | |
134 { | |
135 i = 99 + 14325 + | |
136 21345 + | |
137 21345 + | |
138 21345 + ( 21345 + | |
139 21345) + | |
140 2345 + | |
141 1234; | |
142 c = 1; | |
143 } | |
144 | |
145 /* | |
146 testje for indent with empty line | |
147 | |
148 here */ | |
149 | |
150 { | |
151 if (testing && | |
152 not a joke || | |
153 line up here) | |
154 hay; | |
155 if (testing && | |
156 (not a joke || testing | |
157 )line up here) | |
158 hay; | |
159 if (testing && | |
160 (not a joke || testing | |
161 line up here)) | |
162 hay; | |
163 } | |
164 | |
165 | |
166 { | |
167 switch (c) | |
168 { | |
169 case xx: | |
170 do | |
171 if (asdf) | |
172 do | |
173 asdfasdf; | |
174 while (asdf); | |
175 else | |
176 asdfasdf; | |
177 while (cond); | |
178 case yy: | |
179 case xx: | |
180 case zz: | |
181 testing; | |
182 } | |
183 } | |
184 | |
185 { | |
186 if (cond) { | |
187 foo; | |
188 } | |
189 else | |
190 { | |
191 bar; | |
192 } | |
193 } | |
194 | |
195 { | |
196 if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf | |
197 alsdkfj (asldk;fj | |
198 awith cino=(0 ;lf this one goes to below the paren with == | |
199 ;laksjfd ;lsakdjf ;alskdf asd) | |
200 asdfasdf;))) | |
201 asdfasdf; | |
202 } | |
203 | |
204 int | |
205 func(a, b) | |
206 int a; | |
207 int c; | |
208 { | |
209 if (c1 && (c2 || | |
210 c3)) | |
211 foo; | |
212 if (c1 && | |
213 (c2 || c3) | |
214 ) | |
215 } | |
216 | |
217 { | |
218 while (asd) | |
219 { | |
220 if (asdf) | |
221 if (test) | |
222 if (that) | |
223 { | |
224 if (asdf) | |
225 do | |
226 cdasd; | |
227 while (as | |
228 df); | |
229 } | |
230 else | |
231 if (asdf) | |
232 asdf; | |
233 else | |
234 asdf; | |
235 asdf; | |
236 } | |
237 } | |
238 | |
239 { | |
240 s = "/*"; b = ';' | |
241 s = "/*"; b = ';'; | |
242 a = b; | |
243 } | |
244 | |
245 { | |
246 switch (a) | |
247 { | |
248 case a: | |
249 switch (t) | |
250 { | |
251 case 1: | |
252 cmd; | |
253 break; | |
254 case 2: | |
255 cmd; | |
256 break; | |
257 } | |
258 cmd; | |
259 break; | |
260 case b: | |
261 { | |
262 int i; | |
263 cmd; | |
264 } | |
265 break; | |
266 case c: { | |
267 int i; | |
268 cmd; | |
269 } | |
270 case d: if (cond && | |
271 test) { /* this line doesn't work right */ | |
272 int i; | |
273 cmd; | |
274 } | |
275 break; | |
276 } | |
277 } | |
278 | |
279 { | |
280 if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) && | |
281 (bp_to->b_p_initialized || | |
282 (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL))) | |
283 return; | |
284 label : | |
285 asdf = asdf ? | |
286 asdf : asdf; | |
287 asdf = asdf ? | |
288 asdf: asdf; | |
289 } | |
290 | |
291 /* Special Comments : This function has the added complexity (compared */ | |
292 /* : to addtolist) of having to check for a detail */ | |
293 /* : texture and add that to the list first. */ | |
294 | |
295 char *(array[100]) = { | |
296 "testje", | |
297 "foo", | |
298 "bar", | |
299 } | |
300 | |
301 enum soppie | |
302 { | |
3218 | 303 yes = 0, |
304 no, | |
305 maybe | |
7 | 306 }; |
307 | |
308 typedef enum soppie | |
309 { | |
3218 | 310 yes = 0, |
311 no, | |
312 maybe | |
7 | 313 }; |
314 | |
3218 | 315 static enum |
316 { | |
317 yes = 0, | |
318 no, | |
319 maybe | |
320 } soppie; | |
321 | |
4187 | 322 public static enum |
323 { | |
324 yes = 0, | |
325 no, | |
326 maybe | |
327 } soppie; | |
328 | |
329 static private enum | |
330 { | |
331 yes = 0, | |
332 no, | |
333 maybe | |
334 } soppie; | |
335 | |
7 | 336 { |
337 int a, | |
338 b; | |
339 } | |
340 | |
341 { | |
342 struct Type | |
343 { | |
344 int i; | |
345 char *str; | |
346 } var[] = | |
347 { | |
348 0, "zero", | |
349 1, "one", | |
350 2, "two", | |
351 3, "three" | |
352 }; | |
353 | |
354 float matrix[3][3] = | |
355 { | |
356 { | |
357 0, | |
358 1, | |
359 2 | |
360 }, | |
361 { | |
362 3, | |
363 4, | |
364 5 | |
365 }, | |
366 { | |
367 6, | |
368 7, | |
369 8 | |
370 } | |
371 }; | |
372 } | |
373 | |
374 { | |
375 /* blah ( blah */ | |
376 /* where does this go? */ | |
377 | |
378 /* blah ( blah */ | |
379 cmd; | |
380 | |
381 func(arg1, | |
382 /* comment */ | |
383 arg2); | |
384 a; | |
385 { | |
386 b; | |
387 { | |
388 c; /* Hey, NOW it indents?! */ | |
389 } | |
390 } | |
391 | |
392 { | |
393 func(arg1, | |
394 arg2, | |
395 arg3); | |
396 /* Hey, what am I doing here? Is this coz of the ","? */ | |
397 } | |
398 } | |
399 | |
400 main () | |
401 { | |
402 if (cond) | |
403 { | |
404 a = b; | |
405 } | |
406 if (cond) { | |
407 a = c; | |
408 } | |
409 if (cond) | |
410 a = d; | |
411 return; | |
412 } | |
413 | |
414 { | |
415 case 2: if (asdf && | |
416 asdfasdf) | |
417 aasdf; | |
418 a = 9; | |
419 case 3: if (asdf) | |
420 aasdf; | |
421 a = 9; | |
422 case 4: x = 1; | |
423 y = 2; | |
424 | |
425 label: if (asdf) | |
426 here; | |
427 | |
428 label: if (asdf && | |
429 asdfasdf) | |
430 { | |
431 } | |
432 | |
433 label: if (asdf && | |
434 asdfasdf) { | |
435 there; | |
436 } | |
437 | |
438 label: if (asdf && | |
439 asdfasdf) | |
440 there; | |
441 } | |
442 | |
443 { | |
444 /* | |
445 hello with ":set comments= cino=c5" | |
446 */ | |
447 | |
448 /* | |
449 hello with ":set comments= cino=" | |
450 */ | |
451 } | |
452 | |
453 | |
454 { | |
455 if (a < b) { | |
456 a = a + 1; | |
457 } else | |
458 a = a + 2; | |
459 | |
460 if (a) | |
461 do { | |
462 testing; | |
463 } while (asdfasdf); | |
464 a = b + 1; | |
465 asdfasdf | |
466 } | |
467 | |
6114 | 468 { |
469 for ( int i = 0; | |
470 i < 10; i++ ) | |
471 { | |
472 } | |
473 i = 0; | |
474 } | |
475 | |
7 | 476 class bob |
477 { | |
478 int foo() {return 1;} | |
479 int bar; | |
480 } | |
481 | |
482 main() | |
483 { | |
484 while(1) | |
485 if (foo) | |
486 { | |
487 bar; | |
488 } | |
489 else { | |
490 asdf; | |
491 } | |
492 misplacedline; | |
493 } | |
494 | |
495 { | |
496 if (clipboard.state == SELECT_DONE | |
497 && ((row == clipboard.start.lnum | |
498 && col >= clipboard.start.col) | |
499 || row > clipboard.start.lnum)) | |
500 } | |
501 | |
502 { | |
503 if (1) {i += 4;} | |
504 where_am_i; | |
505 return 0; | |
506 } | |
507 | |
508 { | |
509 { | |
510 } // sdf(asdf | |
511 if (asdf) | |
512 asd; | |
513 } | |
514 | |
515 { | |
516 label1: | |
517 label2: | |
518 } | |
519 | |
520 { | |
521 int fooRet = foo(pBar1, false /*fKB*/, | |
522 true /*fPTB*/, 3 /*nT*/, false /*fDF*/); | |
523 f() { | |
524 for ( i = 0; | |
525 i < m; | |
526 /* c */ i++ ) { | |
527 a = b; | |
528 } | |
529 } | |
530 } | |
531 | |
532 { | |
533 f1(/*comment*/); | |
534 f2(); | |
535 } | |
536 | |
537 { | |
538 do { | |
539 if (foo) { | |
540 } else | |
541 ; | |
542 } while (foo); | |
543 foo(); // was wrong | |
544 } | |
545 | |
546 int x; // no extra indent because of the ; | |
547 void func() | |
548 { | |
549 } | |
550 | |
551 char *tab[] = {"aaa", | |
552 "};", /* }; */ NULL} | |
553 int indented; | |
554 {} | |
555 | |
556 char *a[] = {"aaa", "bbb", | |
557 "ccc", NULL}; | |
558 // here | |
559 | |
560 char *tab[] = {"aaa", | |
561 "xx", /* xx */}; /* asdf */ | |
562 int not_indented; | |
563 | |
564 { | |
565 do { | |
566 switch (bla) | |
567 { | |
568 case 1: if (foo) | |
569 bar; | |
570 } | |
571 } while (boo); | |
572 wrong; | |
573 } | |
574 | |
575 int foo, | |
576 bar; | |
577 int foo; | |
578 | |
579 #if defined(foo) \ | |
580 && defined(bar) | |
581 char * xx = "asdf\ | |
582 foo\ | |
583 bor"; | |
584 int x; | |
585 | |
586 char *foo = "asdf\ | |
587 asdf\ | |
588 asdf", | |
589 *bar; | |
590 | |
591 void f() | |
592 { | |
593 #if defined(foo) \ | |
594 && defined(bar) | |
595 char *foo = "asdf\ | |
596 asdf\ | |
597 asdf", | |
598 *bar; | |
599 { | |
600 int i; | |
601 char *foo = "asdf\ | |
602 asdf\ | |
603 asdf", | |
604 *bar; | |
605 } | |
606 #endif | |
607 } | |
608 #endif | |
609 | |
610 int y; // comment | |
611 // comment | |
612 | |
613 // comment | |
614 | |
615 { | |
616 Constructor(int a, | |
617 int b ) : BaseClass(a) | |
618 { | |
619 } | |
620 } | |
621 | |
622 void foo() | |
623 { | |
624 char one, | |
625 two; | |
626 struct bla piet, | |
627 jan; | |
628 enum foo kees, | |
629 jannie; | |
630 static unsigned sdf, | |
631 krap; | |
632 unsigned int piet, | |
633 jan; | |
634 int | |
635 kees, | |
636 jan; | |
637 } | |
638 | |
639 { | |
640 t(int f, | |
641 int d); // ) | |
642 d(); | |
643 } | |
644 | |
645 Constructor::Constructor(int a, | |
646 int b | |
647 ) : | |
648 BaseClass(a, | |
649 b, | |
650 c), | |
651 mMember(b), | |
652 { | |
653 } | |
654 | |
655 Constructor::Constructor(int a, | |
656 int b ) : | |
657 BaseClass(a) | |
658 { | |
659 } | |
660 | |
661 Constructor::Constructor(int a, | |
662 int b ) /*x*/ : /*x*/ BaseClass(a), | |
663 member(b) | |
664 { | |
665 } | |
666 | |
7206
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
667 A::A(int a, int b) |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
668 : aa(a), |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
669 bb(b), |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
670 cc(c) |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
671 { |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
672 } |
c6a7305972fe
commit https://github.com/vim/vim/commit/e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a
Christian Brabandt <cb@256bit.org>
parents:
7164
diff
changeset
|
673 |
7 | 674 class CAbc : |
675 public BaseClass1, | |
676 protected BaseClass2 | |
677 { | |
678 int Test() { return FALSE; } | |
679 int Test1() { return TRUE; } | |
680 | |
681 CAbc(int a, int b ) : | |
682 BaseClass(a) | |
683 { | |
684 switch(xxx) | |
685 { | |
686 case abc: | |
687 asdf(); | |
688 break; | |
689 | |
690 case 999: | |
691 baer(); | |
692 break; | |
693 } | |
694 } | |
695 | |
696 public: // <-- this was incoreectly indented before!! | |
697 void testfall(); | |
698 protected: | |
699 void testfall(); | |
700 }; | |
701 | |
702 class CAbc : public BaseClass1, | |
703 protected BaseClass2 | |
704 { | |
705 }; | |
706 | |
707 static struct | |
708 { | |
709 int a; | |
710 int b; | |
711 } variable[COUNT] = | |
712 { | |
713 { | |
714 123, | |
715 456 | |
716 }, | |
717 { | |
718 123, | |
719 456 | |
720 } | |
721 }; | |
722 | |
723 static struct | |
724 { | |
725 int a; | |
726 int b; | |
727 } variable[COUNT] = | |
728 { | |
729 { 123, 456 }, | |
730 { 123, 456 } | |
731 }; | |
732 | |
733 void asdf() /* ind_maxparen may cause trouble here */ | |
734 { | |
735 if ((0 | |
736 && 1 | |
737 && 1 | |
738 && 1 | |
739 && 1 | |
740 && 1 | |
741 && 1 | |
742 && 1 | |
743 && 1 | |
744 && 1 | |
745 && 1 | |
746 && 1 | |
747 && 1 | |
748 && 1 | |
749 && 1 | |
750 && 1 | |
751 && 1 | |
752 && 1 | |
753 && 1 | |
754 && 1 | |
755 && 1 | |
756 && 1 | |
757 && 1 | |
758 && 1 | |
759 && 1 | |
760 && 1)) break; | |
761 } | |
762 | |
827 | 763 foo() |
764 { | |
765 a = cond ? foo() : asdf | |
766 + asdf; | |
767 | |
768 a = cond ? | |
769 foo() : asdf | |
770 + asdf; | |
771 } | |
772 | |
773 int main(void) | |
774 { | |
775 if (a) | |
776 if (b) | |
777 2; | |
778 else 3; | |
779 next_line_of_code(); | |
780 } | |
781 | |
828 | 782 barry() |
783 { | |
784 Foo::Foo (int one, | |
785 int two) | |
786 : something(4) | |
787 {} | |
788 } | |
789 | |
790 barry() | |
791 { | |
792 Foo::Foo (int one, int two) | |
793 : something(4) | |
794 {} | |
795 } | |
796 | |
797 Constructor::Constructor(int a, | |
798 int b | |
799 ) : | |
800 BaseClass(a, | |
801 b, | |
802 c), | |
803 mMember(b) | |
804 { | |
805 } | |
829 | 806 int main () |
807 { | |
808 if (lala) | |
809 do | |
810 ++(*lolo); | |
811 while (lili | |
812 && lele); | |
813 lulu; | |
814 } | |
828 | 815 |
829 | 816 int main () |
817 { | |
818 switch (c) | |
819 { | |
820 case 'c': if (cond) | |
821 { | |
822 } | |
823 } | |
824 } | |
825 | |
826 main() | |
827 { | |
828 (void) MyFancyFuasdfadsfnction( | |
829 argument); | |
830 } | |
831 | |
832 main() | |
833 { | |
834 char foo[] = "/*"; | |
835 /* as | |
836 df */ | |
837 hello | |
838 } | |
2857 | 839 |
840 /* valid namespaces with normal indent */ | |
841 namespace | |
842 { | |
843 { | |
844 111111111111; | |
845 } | |
846 } | |
847 namespace /* test */ | |
848 { | |
849 11111111111111111; | |
850 } | |
851 namespace // test | |
852 { | |
853 111111111111111111; | |
854 } | |
855 namespace | |
856 { | |
857 111111111111111111; | |
858 } | |
859 namespace test | |
860 { | |
861 111111111111111111; | |
862 } | |
863 namespace{ | |
864 111111111111111111; | |
865 } | |
866 namespace test{ | |
867 111111111111111111; | |
868 } | |
869 namespace { | |
870 111111111111111111; | |
871 } | |
872 namespace test { | |
873 111111111111111111; | |
874 namespace test2 { | |
875 22222222222222222; | |
876 } | |
877 } | |
878 | |
879 /* invalid namespaces use block indent */ | |
880 namespace test test2 { | |
881 111111111111111111111; | |
882 } | |
883 namespace11111111111 { | |
884 111111111111; | |
885 } | |
886 namespace() { | |
887 1111111111111; | |
888 } | |
889 namespace() | |
890 { | |
891 111111111111111111; | |
892 } | |
893 namespace test test2 | |
894 { | |
895 1111111111111111111; | |
896 } | |
897 namespace111111111 | |
898 { | |
899 111111111111111111; | |
900 } | |
901 | |
6971 | 902 void getstring() { |
903 /* Raw strings */ | |
904 const char* s = R"( | |
905 test { | |
906 # comment | |
907 field: 123 | |
908 } | |
909 )"; | |
910 } | |
911 | |
912 void getstring() { | |
913 const char* s = R"foo( | |
914 test { | |
915 # comment | |
916 field: 123 | |
917 } | |
918 )foo"; | |
919 } | |
920 | |
7160
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
921 { |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
922 int a[4] = { |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
923 [0] = 0, |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
924 [1] = 1, |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
925 [2] = 2, |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
926 [3] = 3, |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
927 }; |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
928 } |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
929 |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
930 { |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
931 a = b[2] |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
932 + 3; |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
933 } |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
934 |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
935 { |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
936 if (1) |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
937 /* aaaaa |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
938 * bbbbb |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
939 */ |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
940 a = 1; |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
941 } |
accd3a0e9bf4
commit https://github.com/vim/vim/commit/089af18d1fd0961ff504ee72db0156bbfe509cdf
Christian Brabandt <cb@256bit.org>
parents:
6971
diff
changeset
|
942 |
7164
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
943 void func() |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
944 { |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
945 switch (foo) |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
946 { |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
947 case (bar): |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
948 if (baz()) |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
949 quux(); |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
950 break; |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
951 case (shmoo): |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
952 if (!bar) |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
953 { |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
954 } |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
955 case (foo1): |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
956 switch (bar) |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
957 { |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
958 case baz: |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
959 baz_f(); |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
960 break; |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
961 } |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
962 break; |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
963 default: |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
964 baz(); |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
965 baz(); |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
966 break; |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
967 } |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
968 } |
d3c57e7f489a
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Christian Brabandt <cb@256bit.org>
parents:
7160
diff
changeset
|
969 |
7 | 970 /* end of AUTO */ |
971 | |
972 STARTTEST | |
973 :set tw=0 wm=60 columns=80 noai fo=croq | |
974 /serious/e | |
975 a about life, the universe, and the rest | |
976 ENDTEST | |
977 | |
978 { | |
979 | |
980 /* this is | |
981 * a real serious important big | |
982 * comment | |
983 */ | |
984 /* insert " about life, the universe, and the rest" after "serious" */ | |
985 } | |
986 | |
987 STARTTEST | |
988 :set nocin | |
989 /comments | |
990 joabout life/happens | |
991 jothere/below | |
992 oline/this | |
993 Ohello | |
994 ENDTEST | |
995 | |
996 { | |
997 /* | |
998 * Testing for comments, without 'cin' set | |
999 */ | |
1000 | |
1001 /* | |
1002 * what happens here? | |
1003 */ | |
1004 | |
1005 /* | |
1006 the end of the comment, try inserting a line below */ | |
1007 | |
1008 /* how about | |
1009 this one */ | |
1010 } | |
1011 | |
1012 STARTTEST | |
1013 :set cin | |
1014 /vec2 | |
1015 == | |
1016 ENDTEST | |
1017 | |
1018 { | |
1019 var = this + that + vec[0] * vec[0] | |
1020 + vec[1] * vec[1] | |
1021 + vec2[2] * vec[2]; | |
1022 } | |
1023 | |
1024 STARTTEST | |
1025 :set cin | |
1026 :set cino=}4 | |
1027 /testing1 | |
1028 k2==/testing2 | |
1029 k2== | |
1030 ENDTEST | |
1031 | |
1032 { | |
1033 asdf asdflkajds f; | |
1034 if (tes & ting) { | |
1035 asdf asdf asdf ; | |
1036 asdfa sdf asdf; | |
1037 } | |
1038 testing1; | |
1039 if (tes & ting) | |
1040 { | |
1041 asdf asdf asdf ; | |
1042 asdfa sdf asdf; | |
1043 } | |
1044 testing2; | |
1045 } | |
1046 | |
1047 STARTTEST | |
1048 :set cin | |
1049 :set cino=(0,)20 | |
1050 /main | |
1051 =][ | |
1052 ENDTEST | |
1053 | |
1054 main ( int first_par, /* | |
1055 * Comment for | |
1056 * first par | |
1057 */ | |
1058 int second_par /* | |
1059 * Comment for | |
1060 * second par | |
1061 */ | |
1062 ) | |
1063 { | |
1064 func( first_par, /* | |
1065 * Comment for | |
1066 * first par | |
1067 */ | |
1068 second_par /* | |
1069 * Comment for | |
1070 * second par | |
1071 */ | |
1072 ); | |
1073 | |
1074 } | |
1075 | |
1076 STARTTEST | |
1077 :set cin | |
3578 | 1078 :set cino=es,n0s |
1079 /main | |
1080 =][ | |
1081 ENDTEST | |
1082 | |
1083 main(void) | |
1084 { | |
1085 /* Make sure that cino=X0s is not parsed like cino=Xs. */ | |
1086 if (cond) | |
1087 foo(); | |
1088 else | |
1089 { | |
1090 bar(); | |
1091 } | |
1092 } | |
1093 | |
1094 STARTTEST | |
1095 :set cin | |
7 | 1096 :set cino= |
1097 ]]=][ | |
1098 ENDTEST | |
1099 | |
1100 { | |
1101 do | |
1102 { | |
1103 if () | |
1104 { | |
1105 if () | |
1106 asdf; | |
1107 else | |
1108 asdf; | |
1109 } | |
1110 } while (); | |
1111 cmd; /* this should go under the } */ | |
1112 } | |
1113 | |
1114 STARTTEST | |
1115 ]]=][ | |
1116 ENDTEST | |
1117 | |
1118 void f() | |
1119 { | |
1120 if ( k() ) { | |
1121 l(); | |
1122 | |
1123 } else { /* Start (two words) end */ | |
1124 m(); | |
1125 } | |
1126 | |
1127 n(); | |
1128 } | |
1129 | |
1130 STARTTEST | |
1131 :set cino={s,e-s | |
1132 ]]=][ | |
1133 ENDTEST | |
1134 | |
1135 void f() | |
1136 { | |
1137 if ( k() ) | |
1138 { | |
1139 l(); | |
1140 } else { /* Start (two words) end */ | |
1141 m(); | |
1142 } | |
1143 n(); /* should be under the if () */ | |
1144 } | |
1145 | |
1146 STARTTEST | |
1147 :set cino={s,fs | |
1148 ]]=/ foo | |
1149 ENDTEST | |
1150 | |
1151 void bar(void) | |
1152 { | |
1153 static array[2][2] = | |
1154 { | |
1155 { 1, 2 }, | |
1156 { 3, 4 }, | |
1157 } | |
1158 | |
1159 while (a) | |
1160 { | |
1161 foo(&a); | |
1162 } | |
1163 | |
1164 { | |
1165 int a; | |
1166 { | |
1167 a = a + 1; | |
1168 } | |
1169 } | |
1170 b = a; | |
1171 } | |
1172 | |
1173 void func(void) | |
1174 { | |
1175 a = 1; | |
1176 { | |
1177 b = 2; | |
1178 } | |
1179 c = 3; | |
1180 d = 4; | |
1181 } | |
1182 /* foo */ | |
1183 | |
1184 STARTTEST | |
1185 :set cino= | |
1186 /while | |
1187 ohere | |
1188 ENDTEST | |
1189 | |
1190 a() | |
1191 { | |
1192 do { | |
1193 a = a + | |
1194 a; | |
1195 } while ( a ); /* add text under this line */ | |
1196 if ( a ) | |
1197 a; | |
1198 } | |
1199 | |
1200 STARTTEST | |
1201 :set cino= com= | |
1202 /comment | |
1203 olabel2: b(); label3 /* post */: /* pre */ label4: f(/*com*/); if (/*com*/) cmd(); | |
1204 ENDTEST | |
1205 | |
1206 a() | |
1207 { | |
1208 label1: | |
1209 /* hmm */ | |
1210 // comment | |
1211 } | |
1212 | |
1213 STARTTEST | |
1214 :set comments& comments^=s:/*,m:**,ex:*/ | |
1215 /simple | |
1216 =5j | |
1217 ENDTEST | |
1218 | |
1219 /* | |
1220 * A simple comment | |
1221 */ | |
1222 | |
1223 /* | |
1224 ** A different comment | |
1225 */ | |
1226 | |
1227 STARTTEST | |
1228 :set cino=c0 | |
1229 :set comments& comments-=s1:/* comments^=s0:/* | |
1230 2kdd]]=][ | |
1231 ENDTEST | |
1232 | |
1233 void f() | |
1234 { | |
1235 | |
1236 /********* | |
1237 A comment. | |
1238 *********/ | |
1239 } | |
1240 | |
1241 STARTTEST | |
1242 :set cino=c0,C1 | |
1243 :set comments& comments-=s1:/* comments^=s0:/* | |
1244 2kdd]]=][ | |
1245 ENDTEST | |
1246 | |
1247 void f() | |
1248 { | |
1249 | |
1250 /********* | |
1251 A comment. | |
1252 *********/ | |
1253 } | |
1254 | |
1255 STARTTEST | |
1256 :set cino= | |
1257 ]]=][ | |
1258 ENDTEST | |
1259 | |
1260 void f() | |
1261 { | |
1262 c = c1 && | |
1263 ( | |
1264 c2 || | |
1265 c3 | |
1266 ) && c4; | |
1267 } | |
1268 | |
1269 STARTTEST | |
1270 :set cino=(s | |
1271 2kdd]]=][ | |
1272 ENDTEST | |
1273 | |
1274 void f() | |
1275 { | |
1276 c = c1 && | |
1277 ( | |
1278 c2 || | |
1279 c3 | |
1280 ) && c4; | |
1281 } | |
1282 | |
1283 STARTTEST | |
1284 :set cino=(s,U1 | |
1285 2kdd]]=][ | |
1286 ENDTEST | |
1287 | |
1288 void f() | |
1289 { | |
1290 c = c1 && | |
1291 ( | |
1292 c2 || | |
1293 c3 | |
1294 ) && c4; | |
1295 } | |
1296 | |
1297 STARTTEST | |
1298 :set cino=(0 | |
1299 2kdd]]=][ | |
1300 ENDTEST | |
1301 | |
1302 void f() | |
1303 { | |
1304 if ( c1 | |
1305 && ( c2 | |
1306 || c3)) | |
1307 foo; | |
1308 } | |
1309 | |
1310 STARTTEST | |
1311 :set cino=(0,w1 | |
1312 2kdd]]=][ | |
1313 ENDTEST | |
1314 | |
1315 void f() | |
1316 { | |
1317 if ( c1 | |
1318 && ( c2 | |
1319 || c3)) | |
1320 foo; | |
1321 } | |
1322 | |
1323 STARTTEST | |
1324 :set cino=(s | |
1325 2kdd]]=][ | |
1326 ENDTEST | |
1327 | |
1328 void f() | |
1329 { | |
1330 c = c1 && ( | |
1331 c2 || | |
1332 c3 | |
1333 ) && c4; | |
1334 if ( | |
1335 c1 && c2 | |
1336 ) | |
1337 foo; | |
1338 } | |
1339 | |
1340 STARTTEST | |
1341 :set cino=(s,m1 | |
1342 2kdd]]=][ | |
1343 ENDTEST | |
1344 | |
1345 void f() | |
1346 { | |
1347 c = c1 && ( | |
1348 c2 || | |
1349 c3 | |
1350 ) && c4; | |
1351 if ( | |
1352 c1 && c2 | |
1353 ) | |
1354 foo; | |
1355 } | |
1356 | |
1357 STARTTEST | |
1358 :set cino=b1 | |
1359 2kdd]]=][ | |
1360 ENDTEST | |
1361 | |
1362 void f() | |
1363 { | |
1364 switch (x) | |
1365 { | |
1366 case 1: | |
1367 a = b; | |
1368 break; | |
1369 default: | |
1370 a = 0; | |
1371 break; | |
1372 } | |
1373 } | |
1374 | |
1375 STARTTEST | |
1376 :set cino=(0,W5 | |
1377 2kdd]]=][ | |
1378 ENDTEST | |
1379 | |
1380 void f() | |
1381 { | |
1382 invokeme( | |
1383 argu, | |
1384 ment); | |
1385 invokeme( | |
1386 argu, | |
1387 ment | |
1388 ); | |
1389 invokeme(argu, | |
1390 ment | |
1391 ); | |
1392 } | |
1393 | |
1394 STARTTEST | |
1395 :set cino=/6 | |
1396 2kdd]]=][ | |
1397 ENDTEST | |
1398 | |
1399 void f() | |
1400 { | |
1401 statement; | |
1402 // comment 1 | |
1403 // comment 2 | |
1404 } | |
1405 | |
1406 STARTTEST | |
1407 :set cino= | |
1408 2kdd]]/comment 1/+1 | |
1409 == | |
1410 ENDTEST | |
1411 | |
1412 void f() | |
1413 { | |
1414 statement; | |
1415 // comment 1 | |
1416 // comment 2 | |
1417 } | |
1418 | |
1419 STARTTEST | |
1420 :set cino=g0 | |
1421 2kdd]]=][ | |
1422 ENDTEST | |
1423 | |
1424 class CAbc | |
1425 { | |
1426 int Test() { return FALSE; } | |
1427 | |
1428 public: // comment | |
1429 void testfall(); | |
1430 protected: | |
1431 void testfall(); | |
1432 }; | |
1433 | |
1434 STARTTEST | |
3123 | 1435 :set cino=(0,gs,hs |
1436 2kdd]]=][ | |
1437 ENDTEST | |
1438 | |
1439 class Foo : public Bar | |
1440 { | |
1441 public: | |
1442 virtual void method1(void) = 0; | |
1443 virtual void method2(int arg1, | |
1444 int arg2, | |
1445 int arg3) = 0; | |
1446 }; | |
1447 | |
1448 STARTTEST | |
828 | 1449 :set cino=+20 |
1450 2kdd]]=][ | |
1451 ENDTEST | |
1452 | |
1453 void | |
1454 foo() | |
1455 { | |
1456 if (a) | |
1457 { | |
1458 } else | |
1459 asdf; | |
1460 } | |
1461 | |
1462 STARTTEST | |
7 | 1463 :set cino=(0,W2s |
1464 2kdd]]=][ | |
1465 ENDTEST | |
1466 | |
1467 { | |
1468 averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd( | |
1469 asdasdf, | |
1470 func(asdf, | |
1471 asdfadsf), | |
1472 asdfasdf | |
1473 ); | |
1474 | |
1475 /* those are ugly, but consequent */ | |
1476 | |
1477 func()->asd(asdasdf, | |
1478 averylongfunctionname( | |
1479 abc, | |
1480 dec)->averylongfunctionname( | |
1481 asdfadsf, | |
1482 asdfasdf, | |
1483 asdfasdf, | |
1484 ), | |
1485 func(asdfadf, | |
1486 asdfasdf | |
1487 ), | |
1488 asdasdf | |
1489 ); | |
1490 | |
1491 averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf( | |
1492 abc, | |
1493 dec)->asdfasdfasdf( | |
1494 asdfadsf, | |
1495 asdfasdf, | |
1496 asdfasdf, | |
1497 ), | |
1498 func(asdfadf, | |
1499 asdfasdf), | |
1500 asdasdf | |
1501 ); | |
1502 } | |
1503 | |
1504 STARTTEST | |
829 | 1505 :set cino=M1 |
1506 2kdd]]=][ | |
1507 ENDTEST | |
1508 | |
1509 int main () | |
1510 { | |
1511 if (cond1 && | |
1512 cond2 | |
1513 ) | |
1514 foo; | |
1515 } | |
1516 | |
1517 STARTTEST | |
2776 | 1518 :set cino=(0,ts |
6030 | 1519 2kdd2j=][ |
2776 | 1520 ENDTEST |
1521 | |
1522 void func(int a | |
1523 #if defined(FOO) | |
1524 , int b | |
1525 , int c | |
1526 #endif | |
1527 ) | |
1528 { | |
1529 } | |
1530 | |
1531 STARTTEST | |
1532 :set cino=(0 | |
6030 | 1533 2kdd2j=][ |
2776 | 1534 ENDTEST |
1535 | |
1536 void | |
1537 func(int a | |
1538 #if defined(FOO) | |
1539 , int b | |
1540 , int c | |
1541 #endif | |
1542 ) | |
1543 { | |
1544 } | |
1545 | |
1546 STARTTEST | |
2805 | 1547 :set cino& |
6030 | 1548 2kdd2j=7][ |
2805 | 1549 ENDTEST |
1550 | |
1551 void func(void) | |
1552 { | |
1553 if(x==y) | |
1554 if(y==z) | |
1555 foo=1; | |
1556 else { bar=1; | |
1557 baz=2; | |
1558 } | |
1559 printf("Foo!\n"); | |
1560 } | |
1561 | |
2843 | 1562 void func1(void) |
1563 { | |
1564 char* tab[] = {"foo", "bar", | |
1565 "baz", "quux", | |
1566 "this line used", "to be indented incorrectly"}; | |
1567 foo(); | |
1568 } | |
1569 | |
1570 void func2(void) | |
1571 { | |
1572 int tab[] = | |
1573 {1, 2, | |
1574 3, 4, | |
1575 5, 6}; | |
1576 | |
1577 printf("This line used to be indented incorrectly.\n"); | |
1578 } | |
1579 | |
3186 | 1580 int foo[] |
1581 #ifdef BAR | |
1582 | |
1583 = { 1, 2, 3, | |
1584 4, 5, 6 } | |
1585 | |
1586 #endif | |
1587 ; | |
1588 int baz; | |
1589 | |
2843 | 1590 void func3(void) |
1591 { | |
1592 int tab[] = { | |
1593 1, 2, | |
1594 3, 4, | |
1595 5, 6}; | |
1596 | |
3220 | 1597 printf("Don't you dare indent this line incorrectly!\n"); |
1598 } | |
1599 | |
1600 void | |
1601 func4(a, b, | |
1602 c) | |
1603 int a; | |
1604 int b; | |
1605 int c; | |
1606 { | |
1607 } | |
1608 | |
1609 void | |
1610 func5( | |
1611 int a, | |
1612 int b) | |
1613 { | |
1614 } | |
1615 | |
1616 void | |
1617 func6( | |
1618 int a) | |
1619 { | |
2843 | 1620 } |
1621 | |
2805 | 1622 STARTTEST |
2807 | 1623 :set cino& |
2953 | 1624 :set cino+=l1 |
6030 | 1625 2kdd2j=][ |
2953 | 1626 ENDTEST |
1627 | |
1628 void func(void) | |
1629 { | |
1630 int tab[] = | |
1631 { | |
1632 1, 2, 3, | |
1633 4, 5, 6}; | |
1634 | |
1635 printf("Indent this line correctly!\n"); | |
1636 | |
1637 switch (foo) | |
1638 { | |
1639 case bar: | |
1640 printf("bar"); | |
1641 break; | |
1642 case baz: { | |
1643 printf("baz"); | |
1644 break; | |
1645 } | |
1646 case quux: | |
1647 printf("But don't break the indentation of this instruction\n"); | |
1648 break; | |
1649 } | |
1650 } | |
1651 | |
1652 STARTTEST | |
1653 :set cino& | |
6030 | 1654 2kdd2j=][ |
2807 | 1655 ENDTEST |
1656 | |
1657 void func(void) | |
1658 { | |
1659 cout << "a" | |
1660 << "b" | |
1661 << ") :" | |
1662 << "c"; | |
1663 } | |
1664 | |
1665 STARTTEST | |
2809 | 1666 :set com=s1:/*,m:*,ex:*/ |
1667 ]]3jofoo(); | |
1668 ENDTEST | |
1669 | |
1670 void func(void) | |
1671 { | |
1672 /* | |
1673 * This is a comment. | |
1674 */ | |
1675 } | |
1676 | |
1677 STARTTEST | |
2855 | 1678 :set cino& |
6030 | 1679 2kdd2j=][ |
2855 | 1680 ENDTEST |
1681 | |
1682 void func(void) | |
1683 { | |
1684 for (int i = 0; i < 10; ++i) | |
1685 if (i & 1) { | |
1686 foo(1); | |
1687 } else | |
1688 foo(0); | |
1689 baz(); | |
1690 } | |
1691 | |
1692 STARTTEST | |
3454 | 1693 :set cino=k2s,(0 |
1694 2kdd3j=][ | |
1695 ENDTEST | |
1696 | |
1697 void func(void) | |
1698 { | |
1699 if (condition1 | |
1700 && condition2) | |
1701 action(); | |
1702 function(argument1 | |
1703 && argument2); | |
1704 | |
1705 if (c1 && (c2 || | |
1706 c3)) | |
1707 foo; | |
1708 if (c1 && | |
1709 (c2 || c3)) | |
1710 { | |
1711 } | |
1712 | |
1713 if ( c1 | |
1714 && ( c2 | |
1715 || c3)) | |
1716 foo; | |
1717 func( c1 | |
1718 && ( c2 | |
1719 || c3)) | |
1720 foo; | |
1721 } | |
1722 | |
1723 STARTTEST | |
1724 :set cino=k2s,(s | |
1725 2kdd3j=][ | |
1726 ENDTEST | |
1727 | |
1728 void func(void) | |
1729 { | |
1730 if (condition1 | |
1731 && condition2) | |
1732 action(); | |
1733 function(argument1 | |
1734 && argument2); | |
1735 | |
1736 if (c1 && (c2 || | |
1737 c3)) | |
1738 foo; | |
1739 if (c1 && | |
1740 (c2 || c3)) | |
1741 { | |
1742 } | |
1743 | |
1744 if ( c1 | |
1745 && ( c2 | |
1746 || c3)) | |
1747 foo; | |
1748 func( c1 | |
1749 && ( c2 | |
1750 || c3)) | |
1751 foo; | |
1752 } | |
1753 | |
1754 STARTTEST | |
1755 :set cino=k2s,(s,U1 | |
1756 2kdd3j=][ | |
1757 ENDTEST | |
1758 | |
1759 void func(void) | |
1760 { | |
1761 if (condition1 | |
1762 && condition2) | |
1763 action(); | |
1764 function(argument1 | |
1765 && argument2); | |
1766 | |
1767 if (c1 && (c2 || | |
1768 c3)) | |
1769 foo; | |
1770 if (c1 && | |
1771 (c2 || c3)) | |
1772 { | |
1773 } | |
1774 if (c123456789 | |
1775 && (c22345 | |
1776 || c3)) | |
1777 printf("foo\n"); | |
1778 | |
1779 c = c1 && | |
1780 ( | |
1781 c2 || | |
1782 c3 | |
1783 ) && c4; | |
1784 } | |
1785 | |
1786 STARTTEST | |
1787 :set cino=k2s,(0,W4 | |
1788 2kdd3j=][ | |
1789 ENDTEST | |
1790 | |
1791 void func(void) | |
1792 { | |
1793 if (condition1 | |
1794 && condition2) | |
1795 action(); | |
1796 function(argument1 | |
1797 && argument2); | |
1798 | |
1799 if (c1 && (c2 || | |
1800 c3)) | |
1801 foo; | |
1802 if (c1 && | |
1803 (c2 || c3)) | |
1804 { | |
1805 } | |
1806 if (c123456789 | |
1807 && (c22345 | |
1808 || c3)) | |
1809 printf("foo\n"); | |
1810 | |
1811 if ( c1 | |
1812 && ( c2 | |
1813 || c3)) | |
1814 foo; | |
1815 | |
1816 a_long_line( | |
1817 argument, | |
1818 argument); | |
1819 a_short_line(argument, | |
1820 argument); | |
1821 } | |
1822 | |
1823 STARTTEST | |
1824 :set cino=k2s,u2 | |
1825 2kdd3j=][ | |
1826 ENDTEST | |
1827 | |
1828 void func(void) | |
1829 { | |
1830 if (condition1 | |
1831 && condition2) | |
1832 action(); | |
1833 function(argument1 | |
1834 && argument2); | |
1835 | |
1836 if (c1 && (c2 || | |
1837 c3)) | |
1838 foo; | |
1839 if (c1 && | |
1840 (c2 || c3)) | |
1841 { | |
1842 } | |
1843 if (c123456789 | |
1844 && (c22345 | |
1845 || c3)) | |
1846 printf("foo\n"); | |
1847 } | |
1848 | |
1849 STARTTEST | |
1850 :set cino=k2s,(0,w1 | |
1851 2kdd3j=][ | |
1852 ENDTEST | |
1853 | |
1854 void func(void) | |
1855 { | |
1856 if (condition1 | |
1857 && condition2) | |
1858 action(); | |
1859 function(argument1 | |
1860 && argument2); | |
1861 | |
1862 if (c1 && (c2 || | |
1863 c3)) | |
1864 foo; | |
1865 if (c1 && | |
1866 (c2 || c3)) | |
1867 { | |
1868 } | |
1869 if (c123456789 | |
1870 && (c22345 | |
1871 || c3)) | |
1872 printf("foo\n"); | |
1873 | |
1874 if ( c1 | |
1875 && ( c2 | |
1876 || c3)) | |
1877 foo; | |
1878 func( c1 | |
1879 && ( c2 | |
1880 || c3)) | |
1881 foo; | |
1882 } | |
1883 | |
1884 STARTTEST | |
1885 :set cino=k2,(s | |
1886 2kdd3j=][ | |
1887 ENDTEST | |
1888 | |
1889 void func(void) | |
1890 { | |
1891 if (condition1 | |
1892 && condition2) | |
1893 action(); | |
1894 function(argument1 | |
1895 && argument2); | |
1896 | |
1897 if (c1 && (c2 || | |
1898 c3)) | |
1899 foo; | |
1900 if (c1 && | |
1901 (c2 || c3)) | |
1902 { | |
1903 } | |
1904 } | |
1905 | |
1906 STARTTEST | |
2857 | 1907 :set cino=N-s |
2879 | 1908 /^NAMESPACESTART |
2857 | 1909 =/^NAMESPACEEND |
1910 ENDTEST | |
1911 | |
2879 | 1912 NAMESPACESTART |
2857 | 1913 /* valid namespaces with normal indent */ |
1914 namespace | |
1915 { | |
1916 { | |
1917 111111111111; | |
1918 } | |
1919 } | |
1920 namespace /* test */ | |
1921 { | |
1922 11111111111111111; | |
1923 } | |
1924 namespace // test | |
1925 { | |
1926 111111111111111111; | |
1927 } | |
1928 namespace | |
1929 { | |
1930 111111111111111111; | |
1931 } | |
1932 namespace test | |
1933 { | |
1934 111111111111111111; | |
1935 } | |
10396
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1936 namespace test::cpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1937 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1938 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1939 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1940 namespace ::incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1941 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1942 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1943 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1944 namespace test::incorrectcpp17:: |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1945 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1946 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1947 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1948 namespace test:incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1949 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1950 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1951 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1952 namespace test:::incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1953 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1954 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1955 } |
2857 | 1956 namespace{ |
1957 111111111111111111; | |
1958 } | |
1959 namespace test{ | |
1960 111111111111111111; | |
1961 } | |
1962 namespace { | |
1963 111111111111111111; | |
1964 } | |
1965 namespace test { | |
1966 111111111111111111; | |
1967 namespace test2 { | |
1968 22222222222222222; | |
1969 } | |
1970 } | |
1971 | |
1972 /* invalid namespaces use block indent */ | |
1973 namespace test test2 { | |
1974 111111111111111111111; | |
1975 } | |
1976 namespace11111111111 { | |
1977 111111111111; | |
1978 } | |
1979 namespace() { | |
1980 1111111111111; | |
1981 } | |
1982 namespace() | |
1983 { | |
1984 111111111111111111; | |
1985 } | |
1986 namespace test test2 | |
1987 { | |
1988 1111111111111111111; | |
1989 } | |
1990 namespace111111111 | |
1991 { | |
1992 111111111111111111; | |
1993 } | |
1994 NAMESPACEEND | |
1995 | |
1996 | |
1997 STARTTEST | |
2968 | 1998 :set cino=j1,J1 |
2879 | 1999 /^JSSTART |
2000 =/^JSEND | |
2001 ENDTEST | |
2002 | |
2003 JSSTART | |
2004 var bar = { | |
2005 foo: { | |
2006 that: this, | |
2007 some: ok, | |
2008 }, | |
2009 "bar":{ | |
2010 a : 2, | |
2011 b: "123abc", | |
2012 x: 4, | |
2013 "y": 5 | |
2014 } | |
2015 } | |
2016 JSEND | |
2017 | |
2018 STARTTEST | |
2968 | 2019 :set cino=j1,J1 |
2020 /^JSSTART | |
2021 =/^JSEND | |
2022 ENDTEST | |
2023 | |
2024 JSSTART | |
2025 var foo = [ | |
6030 | 2026 1, |
2968 | 2027 2, |
2028 3 | |
6030 | 2029 ]; |
2968 | 2030 JSEND |
2031 | |
2032 STARTTEST | |
2033 :set cino=j1,J1 | |
2034 /^JSSTART | |
2035 =/^JSEND | |
2036 ENDTEST | |
2037 | |
2038 JSSTART | |
2039 function bar() { | |
2040 var foo = [ | |
2041 1, | |
2042 2, | |
2043 3 | |
6030 | 2044 ]; |
2968 | 2045 } |
2046 JSEND | |
2047 | |
2048 STARTTEST | |
2049 :set cino=j1,J1 | |
2050 /^JSSTART | |
2051 =/^JSEND | |
2052 ENDTEST | |
2053 | |
2054 JSSTART | |
2055 (function($){ | |
2056 | |
6020 | 2057 if (cond && |
2058 cond) { | |
2059 stmt; | |
2060 } | |
6030 | 2061 window.something.left = |
2062 (width - 50 + offset) + "px"; | |
2968 | 2063 var class_name='myclass'; |
2064 | |
2065 function private_method() { | |
2066 } | |
2067 | |
2068 var public_method={ | |
2069 method: function(options,args){ | |
2070 private_method(); | |
2071 } | |
2072 } | |
2073 | |
2074 function init(options) { | |
2075 | |
2076 $(this).data(class_name+'_public',$.extend({},{ | |
2077 foo: 'bar', | |
6030 | 2078 bar: 2, |
2079 foobar: [ | |
2080 1, | |
2081 2, | |
2082 3 | |
2968 | 2083 ], |
6030 | 2084 callback: function(){ |
2085 return true; | |
2086 } | |
2968 | 2087 }, options||{})); |
2088 } | |
2089 | |
2090 $.fn[class_name]=function() { | |
2091 | |
2092 var _arguments=arguments; | |
2093 return this.each(function(){ | |
2094 | |
2095 var options=$(this).data(class_name+'_public'); | |
2096 if (!options) { | |
2097 init.apply(this,_arguments); | |
2098 | |
2099 } else { | |
2100 var method=public_method[_arguments[0]]; | |
2101 | |
2102 if (typeof(method)!='function') { | |
2103 console.log(class_name+' has no method "'+_arguments[0]+'"'); | |
2104 return false; | |
2105 } | |
2106 _arguments[0]=options; | |
2107 method.apply(this,_arguments); | |
2108 } | |
2109 }); | |
2110 } | |
2111 | |
2112 })(jQuery); | |
2113 JSEND | |
2114 | |
2115 STARTTEST | |
2116 :set cino=j1,J1 | |
2117 /^JSSTART | |
2118 =/^JSEND | |
2119 ENDTEST | |
2120 | |
2121 JSSTART | |
2122 function init(options) { | |
2123 $(this).data(class_name+'_public',$.extend({},{ | |
2124 foo: 'bar', | |
2125 bar: 2, | |
2126 foobar: [ | |
6030 | 2127 1, |
2128 2, | |
2129 3 | |
2968 | 2130 ], |
2131 callback: function(){ | |
2132 return true; | |
2133 } | |
2134 }, options||{})); | |
2135 } | |
2136 JSEND | |
2137 | |
2138 STARTTEST | |
2139 :set cino=j1,J1 | |
2140 /^JSSTART | |
2141 =/^JSEND | |
2142 ENDTEST | |
2143 | |
2144 JSSTART | |
2145 (function($){ | |
2146 function init(options) { | |
2147 $(this).data(class_name+'_public',$.extend({},{ | |
2148 foo: 'bar', | |
6030 | 2149 bar: 2, |
2150 foobar: [ | |
2151 1, | |
2152 2, | |
2153 3 | |
2968 | 2154 ], |
6030 | 2155 callback: function(){ |
2156 return true; | |
2157 } | |
2968 | 2158 }, options||{})); |
2159 } | |
2160 })(jQuery); | |
2161 JSEND | |
2162 | |
2163 STARTTEST | |
6691 | 2164 :set cino=j1,J1,+2 |
2165 /^JSSTART | |
2166 =/^JSEND | |
2167 ENDTEST | |
2168 | |
2169 JSSTART | |
2170 // Results of JavaScript indent | |
2171 // 1 | |
2172 (function(){ | |
2173 var a = [ | |
2174 'a', | |
2175 'b', | |
2176 'c', | |
2177 'd', | |
2178 'e', | |
2179 'f', | |
2180 'g', | |
2181 'h', | |
2182 'i' | |
2183 ]; | |
2184 }()) | |
2185 | |
2186 // 2 | |
2187 (function(){ | |
2188 var a = [ | |
2189 0 + | |
2190 5 * | |
2191 9 * | |
2192 'a', | |
2193 'b', | |
2194 0 + | |
2195 5 * | |
2196 9 * | |
2197 'c', | |
2198 'd', | |
2199 'e', | |
2200 'f', | |
2201 'g', | |
2202 'h', | |
2203 'i' | |
2204 ]; | |
2205 }()) | |
2206 | |
2207 // 3 | |
2208 (function(){ | |
2209 var a = [ | |
2210 0 + | |
2211 // comment 1 | |
2212 5 * | |
2213 /* comment 2 */ | |
2214 9 * | |
2215 'a', | |
2216 'b', | |
2217 0 + | |
2218 5 * | |
2219 9 * | |
2220 'c', | |
2221 'd', | |
2222 'e', | |
2223 'f', | |
2224 'g', | |
2225 'h', | |
2226 'i' | |
2227 ]; | |
2228 }()) | |
2229 | |
2230 // 4 | |
2231 { | |
2232 var a = [ | |
2233 0, | |
2234 1 | |
2235 ]; | |
2236 var b; | |
2237 var c; | |
2238 } | |
2239 | |
2240 // 5 | |
2241 { | |
2242 var a = [ | |
2243 [ | |
2244 0 | |
2245 ], | |
2246 2, | |
2247 3 | |
2248 ]; | |
2249 } | |
2250 | |
2251 // 6 | |
2252 { | |
2253 var a = [ | |
2254 [ | |
2255 0, | |
2256 1 | |
2257 ], | |
2258 2, | |
2259 3 | |
2260 ]; | |
2261 } | |
2262 | |
2263 // 7 | |
2264 { | |
2265 var a = [ | |
2266 // [ | |
2267 0, | |
2268 // 1 | |
2269 // ], | |
2270 2, | |
2271 3 | |
2272 ]; | |
2273 } | |
2274 | |
2275 // 8 | |
2276 var x = [ | |
2277 (function(){ | |
2278 var a, | |
2279 b, | |
2280 c, | |
2281 d, | |
2282 e, | |
2283 f, | |
2284 g, | |
2285 h, | |
2286 i; | |
2287 }) | |
2288 ]; | |
2289 | |
2290 // 9 | |
2291 var a = [ | |
2292 0 + | |
2293 5 * | |
2294 9 * | |
2295 'a', | |
2296 'b', | |
2297 0 + | |
2298 5 * | |
2299 9 * | |
2300 'c', | |
2301 'd', | |
2302 'e', | |
2303 'f', | |
2304 'g', | |
2305 'h', | |
2306 'i' | |
2307 ]; | |
2308 | |
2309 // 10 | |
2310 var a, | |
2311 b, | |
2312 c, | |
2313 d, | |
2314 e, | |
2315 f, | |
2316 g, | |
2317 h, | |
2318 i; | |
2319 JSEND | |
2320 | |
2321 STARTTEST | |
10516
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2322 :set cin cino& |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2323 /start of define |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2324 =/end of define |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2325 ENDTEST |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2326 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2327 /* start of define */ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2328 { |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2329 } |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2330 #define AAA \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2331 BBB\ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2332 CCC |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2333 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2334 #define CNT \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2335 1 + \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2336 2 + \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2337 4 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2338 /* end of define */ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2339 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2340 STARTTEST |
7 | 2341 :g/^STARTTEST/.,/^ENDTEST/d |
2342 :1;/start of AUTO/,$wq! test.out | |
2343 ENDTEST |