Mercurial > vim
annotate src/testdir/test3.in @ 11424:328a9ee98fb2 v8.0.0596
patch 8.0.0596: crash when complete() called after complete_add()
commit https://github.com/vim/vim/commit/4475b623960671898dac6a72b13a8d140402afa6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 1 20:46:52 2017 +0200
patch 8.0.0596: crash when complete() called after complete_add()
Problem: Crash when complete() is called after complete_add() in
'completefunc'. (Lifepillar)
Solution: Bail out if compl_pattern is NULL. (closes #1668)
Also avoid using freed memory.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 01 May 2017 21:00:04 +0200 |
parents | 4618af3049fe |
children | 91222b3123ba |
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 | |
11111
4618af3049fe
patch 8.0.0443: terminal width is set to 80 in test3
Christian Brabandt <cb@256bit.org>
parents:
11069
diff
changeset
|
973 :set tw=0 noai fo=croq |
4618af3049fe
patch 8.0.0443: terminal width is set to 80 in test3
Christian Brabandt <cb@256bit.org>
parents:
11069
diff
changeset
|
974 :let &wm = &columns - 20 |
7 | 975 /serious/e |
976 a about life, the universe, and the rest | |
977 ENDTEST | |
978 | |
979 { | |
980 | |
981 /* this is | |
982 * a real serious important big | |
983 * comment | |
984 */ | |
985 /* insert " about life, the universe, and the rest" after "serious" */ | |
986 } | |
987 | |
988 STARTTEST | |
989 :set nocin | |
990 /comments | |
991 joabout life/happens | |
992 jothere/below | |
993 oline/this | |
994 Ohello | |
995 ENDTEST | |
996 | |
997 { | |
998 /* | |
999 * Testing for comments, without 'cin' set | |
1000 */ | |
1001 | |
1002 /* | |
1003 * what happens here? | |
1004 */ | |
1005 | |
1006 /* | |
1007 the end of the comment, try inserting a line below */ | |
1008 | |
1009 /* how about | |
1010 this one */ | |
1011 } | |
1012 | |
1013 STARTTEST | |
1014 :set cin | |
1015 /vec2 | |
1016 == | |
1017 ENDTEST | |
1018 | |
1019 { | |
1020 var = this + that + vec[0] * vec[0] | |
1021 + vec[1] * vec[1] | |
1022 + vec2[2] * vec[2]; | |
1023 } | |
1024 | |
1025 STARTTEST | |
1026 :set cin | |
1027 :set cino=}4 | |
1028 /testing1 | |
1029 k2==/testing2 | |
1030 k2== | |
1031 ENDTEST | |
1032 | |
1033 { | |
1034 asdf asdflkajds f; | |
1035 if (tes & ting) { | |
1036 asdf asdf asdf ; | |
1037 asdfa sdf asdf; | |
1038 } | |
1039 testing1; | |
1040 if (tes & ting) | |
1041 { | |
1042 asdf asdf asdf ; | |
1043 asdfa sdf asdf; | |
1044 } | |
1045 testing2; | |
1046 } | |
1047 | |
1048 STARTTEST | |
1049 :set cin | |
1050 :set cino=(0,)20 | |
1051 /main | |
1052 =][ | |
1053 ENDTEST | |
1054 | |
1055 main ( int first_par, /* | |
1056 * Comment for | |
1057 * first par | |
1058 */ | |
1059 int second_par /* | |
1060 * Comment for | |
1061 * second par | |
1062 */ | |
1063 ) | |
1064 { | |
1065 func( first_par, /* | |
1066 * Comment for | |
1067 * first par | |
1068 */ | |
1069 second_par /* | |
1070 * Comment for | |
1071 * second par | |
1072 */ | |
1073 ); | |
1074 | |
1075 } | |
1076 | |
1077 STARTTEST | |
1078 :set cin | |
3578 | 1079 :set cino=es,n0s |
1080 /main | |
1081 =][ | |
1082 ENDTEST | |
1083 | |
1084 main(void) | |
1085 { | |
1086 /* Make sure that cino=X0s is not parsed like cino=Xs. */ | |
1087 if (cond) | |
1088 foo(); | |
1089 else | |
1090 { | |
1091 bar(); | |
1092 } | |
1093 } | |
1094 | |
1095 STARTTEST | |
1096 :set cin | |
7 | 1097 :set cino= |
1098 ]]=][ | |
1099 ENDTEST | |
1100 | |
1101 { | |
1102 do | |
1103 { | |
1104 if () | |
1105 { | |
1106 if () | |
1107 asdf; | |
1108 else | |
1109 asdf; | |
1110 } | |
1111 } while (); | |
1112 cmd; /* this should go under the } */ | |
1113 } | |
1114 | |
1115 STARTTEST | |
1116 ]]=][ | |
1117 ENDTEST | |
1118 | |
1119 void f() | |
1120 { | |
1121 if ( k() ) { | |
1122 l(); | |
1123 | |
1124 } else { /* Start (two words) end */ | |
1125 m(); | |
1126 } | |
1127 | |
1128 n(); | |
1129 } | |
1130 | |
1131 STARTTEST | |
1132 :set cino={s,e-s | |
1133 ]]=][ | |
1134 ENDTEST | |
1135 | |
1136 void f() | |
1137 { | |
1138 if ( k() ) | |
1139 { | |
1140 l(); | |
1141 } else { /* Start (two words) end */ | |
1142 m(); | |
1143 } | |
1144 n(); /* should be under the if () */ | |
1145 } | |
1146 | |
1147 STARTTEST | |
1148 :set cino={s,fs | |
1149 ]]=/ foo | |
1150 ENDTEST | |
1151 | |
1152 void bar(void) | |
1153 { | |
1154 static array[2][2] = | |
1155 { | |
1156 { 1, 2 }, | |
1157 { 3, 4 }, | |
1158 } | |
1159 | |
1160 while (a) | |
1161 { | |
1162 foo(&a); | |
1163 } | |
1164 | |
1165 { | |
1166 int a; | |
1167 { | |
1168 a = a + 1; | |
1169 } | |
1170 } | |
1171 b = a; | |
1172 } | |
1173 | |
1174 void func(void) | |
1175 { | |
1176 a = 1; | |
1177 { | |
1178 b = 2; | |
1179 } | |
1180 c = 3; | |
1181 d = 4; | |
1182 } | |
1183 /* foo */ | |
1184 | |
1185 STARTTEST | |
1186 :set cino= | |
1187 /while | |
1188 ohere | |
1189 ENDTEST | |
1190 | |
1191 a() | |
1192 { | |
1193 do { | |
1194 a = a + | |
1195 a; | |
1196 } while ( a ); /* add text under this line */ | |
1197 if ( a ) | |
1198 a; | |
1199 } | |
1200 | |
1201 STARTTEST | |
1202 :set cino= com= | |
1203 /comment | |
1204 olabel2: b(); label3 /* post */: /* pre */ label4: f(/*com*/); if (/*com*/) cmd(); | |
1205 ENDTEST | |
1206 | |
1207 a() | |
1208 { | |
1209 label1: | |
1210 /* hmm */ | |
1211 // comment | |
1212 } | |
1213 | |
1214 STARTTEST | |
1215 :set comments& comments^=s:/*,m:**,ex:*/ | |
1216 /simple | |
1217 =5j | |
1218 ENDTEST | |
1219 | |
1220 /* | |
1221 * A simple comment | |
1222 */ | |
1223 | |
1224 /* | |
1225 ** A different comment | |
1226 */ | |
1227 | |
1228 STARTTEST | |
1229 :set cino=c0 | |
1230 :set comments& comments-=s1:/* comments^=s0:/* | |
1231 2kdd]]=][ | |
1232 ENDTEST | |
1233 | |
1234 void f() | |
1235 { | |
1236 | |
1237 /********* | |
1238 A comment. | |
1239 *********/ | |
1240 } | |
1241 | |
1242 STARTTEST | |
1243 :set cino=c0,C1 | |
1244 :set comments& comments-=s1:/* comments^=s0:/* | |
1245 2kdd]]=][ | |
1246 ENDTEST | |
1247 | |
1248 void f() | |
1249 { | |
1250 | |
1251 /********* | |
1252 A comment. | |
1253 *********/ | |
1254 } | |
1255 | |
1256 STARTTEST | |
1257 :set cino= | |
1258 ]]=][ | |
1259 ENDTEST | |
1260 | |
1261 void f() | |
1262 { | |
1263 c = c1 && | |
1264 ( | |
1265 c2 || | |
1266 c3 | |
1267 ) && c4; | |
1268 } | |
1269 | |
1270 STARTTEST | |
1271 :set cino=(s | |
1272 2kdd]]=][ | |
1273 ENDTEST | |
1274 | |
1275 void f() | |
1276 { | |
1277 c = c1 && | |
1278 ( | |
1279 c2 || | |
1280 c3 | |
1281 ) && c4; | |
1282 } | |
1283 | |
1284 STARTTEST | |
1285 :set cino=(s,U1 | |
1286 2kdd]]=][ | |
1287 ENDTEST | |
1288 | |
1289 void f() | |
1290 { | |
1291 c = c1 && | |
1292 ( | |
1293 c2 || | |
1294 c3 | |
1295 ) && c4; | |
1296 } | |
1297 | |
1298 STARTTEST | |
1299 :set cino=(0 | |
1300 2kdd]]=][ | |
1301 ENDTEST | |
1302 | |
1303 void f() | |
1304 { | |
1305 if ( c1 | |
1306 && ( c2 | |
1307 || c3)) | |
1308 foo; | |
1309 } | |
1310 | |
1311 STARTTEST | |
1312 :set cino=(0,w1 | |
1313 2kdd]]=][ | |
1314 ENDTEST | |
1315 | |
1316 void f() | |
1317 { | |
1318 if ( c1 | |
1319 && ( c2 | |
1320 || c3)) | |
1321 foo; | |
1322 } | |
1323 | |
1324 STARTTEST | |
1325 :set cino=(s | |
1326 2kdd]]=][ | |
1327 ENDTEST | |
1328 | |
1329 void f() | |
1330 { | |
1331 c = c1 && ( | |
1332 c2 || | |
1333 c3 | |
1334 ) && c4; | |
1335 if ( | |
1336 c1 && c2 | |
1337 ) | |
1338 foo; | |
1339 } | |
1340 | |
1341 STARTTEST | |
1342 :set cino=(s,m1 | |
1343 2kdd]]=][ | |
1344 ENDTEST | |
1345 | |
1346 void f() | |
1347 { | |
1348 c = c1 && ( | |
1349 c2 || | |
1350 c3 | |
1351 ) && c4; | |
1352 if ( | |
1353 c1 && c2 | |
1354 ) | |
1355 foo; | |
1356 } | |
1357 | |
1358 STARTTEST | |
1359 :set cino=b1 | |
1360 2kdd]]=][ | |
1361 ENDTEST | |
1362 | |
1363 void f() | |
1364 { | |
1365 switch (x) | |
1366 { | |
1367 case 1: | |
1368 a = b; | |
1369 break; | |
1370 default: | |
1371 a = 0; | |
1372 break; | |
1373 } | |
1374 } | |
1375 | |
1376 STARTTEST | |
1377 :set cino=(0,W5 | |
1378 2kdd]]=][ | |
1379 ENDTEST | |
1380 | |
1381 void f() | |
1382 { | |
1383 invokeme( | |
1384 argu, | |
1385 ment); | |
1386 invokeme( | |
1387 argu, | |
1388 ment | |
1389 ); | |
1390 invokeme(argu, | |
1391 ment | |
1392 ); | |
1393 } | |
1394 | |
1395 STARTTEST | |
1396 :set cino=/6 | |
1397 2kdd]]=][ | |
1398 ENDTEST | |
1399 | |
1400 void f() | |
1401 { | |
1402 statement; | |
1403 // comment 1 | |
1404 // comment 2 | |
1405 } | |
1406 | |
1407 STARTTEST | |
1408 :set cino= | |
1409 2kdd]]/comment 1/+1 | |
1410 == | |
1411 ENDTEST | |
1412 | |
1413 void f() | |
1414 { | |
1415 statement; | |
1416 // comment 1 | |
1417 // comment 2 | |
1418 } | |
1419 | |
1420 STARTTEST | |
1421 :set cino=g0 | |
1422 2kdd]]=][ | |
1423 ENDTEST | |
1424 | |
1425 class CAbc | |
1426 { | |
1427 int Test() { return FALSE; } | |
1428 | |
1429 public: // comment | |
1430 void testfall(); | |
1431 protected: | |
1432 void testfall(); | |
1433 }; | |
1434 | |
1435 STARTTEST | |
3123 | 1436 :set cino=(0,gs,hs |
1437 2kdd]]=][ | |
1438 ENDTEST | |
1439 | |
1440 class Foo : public Bar | |
1441 { | |
1442 public: | |
1443 virtual void method1(void) = 0; | |
1444 virtual void method2(int arg1, | |
1445 int arg2, | |
1446 int arg3) = 0; | |
1447 }; | |
1448 | |
1449 STARTTEST | |
828 | 1450 :set cino=+20 |
1451 2kdd]]=][ | |
1452 ENDTEST | |
1453 | |
1454 void | |
1455 foo() | |
1456 { | |
1457 if (a) | |
1458 { | |
1459 } else | |
1460 asdf; | |
1461 } | |
1462 | |
1463 STARTTEST | |
7 | 1464 :set cino=(0,W2s |
1465 2kdd]]=][ | |
1466 ENDTEST | |
1467 | |
1468 { | |
1469 averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd( | |
1470 asdasdf, | |
1471 func(asdf, | |
1472 asdfadsf), | |
1473 asdfasdf | |
1474 ); | |
1475 | |
1476 /* those are ugly, but consequent */ | |
1477 | |
1478 func()->asd(asdasdf, | |
1479 averylongfunctionname( | |
1480 abc, | |
1481 dec)->averylongfunctionname( | |
1482 asdfadsf, | |
1483 asdfasdf, | |
1484 asdfasdf, | |
1485 ), | |
1486 func(asdfadf, | |
1487 asdfasdf | |
1488 ), | |
1489 asdasdf | |
1490 ); | |
1491 | |
1492 averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf( | |
1493 abc, | |
1494 dec)->asdfasdfasdf( | |
1495 asdfadsf, | |
1496 asdfasdf, | |
1497 asdfasdf, | |
1498 ), | |
1499 func(asdfadf, | |
1500 asdfasdf), | |
1501 asdasdf | |
1502 ); | |
1503 } | |
1504 | |
1505 STARTTEST | |
829 | 1506 :set cino=M1 |
1507 2kdd]]=][ | |
1508 ENDTEST | |
1509 | |
1510 int main () | |
1511 { | |
1512 if (cond1 && | |
1513 cond2 | |
1514 ) | |
1515 foo; | |
1516 } | |
1517 | |
1518 STARTTEST | |
2776 | 1519 :set cino=(0,ts |
6030 | 1520 2kdd2j=][ |
2776 | 1521 ENDTEST |
1522 | |
1523 void func(int a | |
1524 #if defined(FOO) | |
1525 , int b | |
1526 , int c | |
1527 #endif | |
1528 ) | |
1529 { | |
1530 } | |
1531 | |
1532 STARTTEST | |
1533 :set cino=(0 | |
6030 | 1534 2kdd2j=][ |
2776 | 1535 ENDTEST |
1536 | |
1537 void | |
1538 func(int a | |
1539 #if defined(FOO) | |
1540 , int b | |
1541 , int c | |
1542 #endif | |
1543 ) | |
1544 { | |
1545 } | |
1546 | |
1547 STARTTEST | |
2805 | 1548 :set cino& |
6030 | 1549 2kdd2j=7][ |
2805 | 1550 ENDTEST |
1551 | |
1552 void func(void) | |
1553 { | |
1554 if(x==y) | |
1555 if(y==z) | |
1556 foo=1; | |
1557 else { bar=1; | |
1558 baz=2; | |
1559 } | |
1560 printf("Foo!\n"); | |
1561 } | |
1562 | |
2843 | 1563 void func1(void) |
1564 { | |
1565 char* tab[] = {"foo", "bar", | |
1566 "baz", "quux", | |
1567 "this line used", "to be indented incorrectly"}; | |
1568 foo(); | |
1569 } | |
1570 | |
1571 void func2(void) | |
1572 { | |
1573 int tab[] = | |
1574 {1, 2, | |
1575 3, 4, | |
1576 5, 6}; | |
1577 | |
1578 printf("This line used to be indented incorrectly.\n"); | |
1579 } | |
1580 | |
3186 | 1581 int foo[] |
1582 #ifdef BAR | |
1583 | |
1584 = { 1, 2, 3, | |
1585 4, 5, 6 } | |
1586 | |
1587 #endif | |
1588 ; | |
1589 int baz; | |
1590 | |
2843 | 1591 void func3(void) |
1592 { | |
1593 int tab[] = { | |
1594 1, 2, | |
1595 3, 4, | |
1596 5, 6}; | |
1597 | |
3220 | 1598 printf("Don't you dare indent this line incorrectly!\n"); |
1599 } | |
1600 | |
1601 void | |
1602 func4(a, b, | |
1603 c) | |
1604 int a; | |
1605 int b; | |
1606 int c; | |
1607 { | |
1608 } | |
1609 | |
1610 void | |
1611 func5( | |
1612 int a, | |
1613 int b) | |
1614 { | |
1615 } | |
1616 | |
1617 void | |
1618 func6( | |
1619 int a) | |
1620 { | |
2843 | 1621 } |
1622 | |
2805 | 1623 STARTTEST |
2807 | 1624 :set cino& |
2953 | 1625 :set cino+=l1 |
6030 | 1626 2kdd2j=][ |
2953 | 1627 ENDTEST |
1628 | |
1629 void func(void) | |
1630 { | |
1631 int tab[] = | |
1632 { | |
1633 1, 2, 3, | |
1634 4, 5, 6}; | |
1635 | |
1636 printf("Indent this line correctly!\n"); | |
1637 | |
1638 switch (foo) | |
1639 { | |
1640 case bar: | |
1641 printf("bar"); | |
1642 break; | |
1643 case baz: { | |
1644 printf("baz"); | |
1645 break; | |
1646 } | |
1647 case quux: | |
1648 printf("But don't break the indentation of this instruction\n"); | |
1649 break; | |
1650 } | |
1651 } | |
1652 | |
1653 STARTTEST | |
1654 :set cino& | |
6030 | 1655 2kdd2j=][ |
2807 | 1656 ENDTEST |
1657 | |
1658 void func(void) | |
1659 { | |
1660 cout << "a" | |
1661 << "b" | |
1662 << ") :" | |
1663 << "c"; | |
1664 } | |
1665 | |
1666 STARTTEST | |
2809 | 1667 :set com=s1:/*,m:*,ex:*/ |
1668 ]]3jofoo(); | |
1669 ENDTEST | |
1670 | |
1671 void func(void) | |
1672 { | |
1673 /* | |
1674 * This is a comment. | |
1675 */ | |
1676 } | |
1677 | |
1678 STARTTEST | |
2855 | 1679 :set cino& |
6030 | 1680 2kdd2j=][ |
2855 | 1681 ENDTEST |
1682 | |
1683 void func(void) | |
1684 { | |
1685 for (int i = 0; i < 10; ++i) | |
1686 if (i & 1) { | |
1687 foo(1); | |
1688 } else | |
1689 foo(0); | |
1690 baz(); | |
1691 } | |
1692 | |
1693 STARTTEST | |
3454 | 1694 :set cino=k2s,(0 |
1695 2kdd3j=][ | |
1696 ENDTEST | |
1697 | |
1698 void func(void) | |
1699 { | |
1700 if (condition1 | |
1701 && condition2) | |
1702 action(); | |
1703 function(argument1 | |
1704 && argument2); | |
1705 | |
1706 if (c1 && (c2 || | |
1707 c3)) | |
1708 foo; | |
1709 if (c1 && | |
1710 (c2 || c3)) | |
1711 { | |
1712 } | |
1713 | |
1714 if ( c1 | |
1715 && ( c2 | |
1716 || c3)) | |
1717 foo; | |
1718 func( c1 | |
1719 && ( c2 | |
1720 || c3)) | |
1721 foo; | |
1722 } | |
1723 | |
1724 STARTTEST | |
1725 :set cino=k2s,(s | |
1726 2kdd3j=][ | |
1727 ENDTEST | |
1728 | |
1729 void func(void) | |
1730 { | |
1731 if (condition1 | |
1732 && condition2) | |
1733 action(); | |
1734 function(argument1 | |
1735 && argument2); | |
1736 | |
1737 if (c1 && (c2 || | |
1738 c3)) | |
1739 foo; | |
1740 if (c1 && | |
1741 (c2 || c3)) | |
1742 { | |
1743 } | |
1744 | |
1745 if ( c1 | |
1746 && ( c2 | |
1747 || c3)) | |
1748 foo; | |
1749 func( c1 | |
1750 && ( c2 | |
1751 || c3)) | |
1752 foo; | |
1753 } | |
1754 | |
1755 STARTTEST | |
1756 :set cino=k2s,(s,U1 | |
1757 2kdd3j=][ | |
1758 ENDTEST | |
1759 | |
1760 void func(void) | |
1761 { | |
1762 if (condition1 | |
1763 && condition2) | |
1764 action(); | |
1765 function(argument1 | |
1766 && argument2); | |
1767 | |
1768 if (c1 && (c2 || | |
1769 c3)) | |
1770 foo; | |
1771 if (c1 && | |
1772 (c2 || c3)) | |
1773 { | |
1774 } | |
1775 if (c123456789 | |
1776 && (c22345 | |
1777 || c3)) | |
1778 printf("foo\n"); | |
1779 | |
1780 c = c1 && | |
1781 ( | |
1782 c2 || | |
1783 c3 | |
1784 ) && c4; | |
1785 } | |
1786 | |
1787 STARTTEST | |
1788 :set cino=k2s,(0,W4 | |
1789 2kdd3j=][ | |
1790 ENDTEST | |
1791 | |
1792 void func(void) | |
1793 { | |
1794 if (condition1 | |
1795 && condition2) | |
1796 action(); | |
1797 function(argument1 | |
1798 && argument2); | |
1799 | |
1800 if (c1 && (c2 || | |
1801 c3)) | |
1802 foo; | |
1803 if (c1 && | |
1804 (c2 || c3)) | |
1805 { | |
1806 } | |
1807 if (c123456789 | |
1808 && (c22345 | |
1809 || c3)) | |
1810 printf("foo\n"); | |
1811 | |
1812 if ( c1 | |
1813 && ( c2 | |
1814 || c3)) | |
1815 foo; | |
1816 | |
1817 a_long_line( | |
1818 argument, | |
1819 argument); | |
1820 a_short_line(argument, | |
1821 argument); | |
1822 } | |
1823 | |
1824 STARTTEST | |
1825 :set cino=k2s,u2 | |
1826 2kdd3j=][ | |
1827 ENDTEST | |
1828 | |
1829 void func(void) | |
1830 { | |
1831 if (condition1 | |
1832 && condition2) | |
1833 action(); | |
1834 function(argument1 | |
1835 && argument2); | |
1836 | |
1837 if (c1 && (c2 || | |
1838 c3)) | |
1839 foo; | |
1840 if (c1 && | |
1841 (c2 || c3)) | |
1842 { | |
1843 } | |
1844 if (c123456789 | |
1845 && (c22345 | |
1846 || c3)) | |
1847 printf("foo\n"); | |
1848 } | |
1849 | |
1850 STARTTEST | |
1851 :set cino=k2s,(0,w1 | |
1852 2kdd3j=][ | |
1853 ENDTEST | |
1854 | |
1855 void func(void) | |
1856 { | |
1857 if (condition1 | |
1858 && condition2) | |
1859 action(); | |
1860 function(argument1 | |
1861 && argument2); | |
1862 | |
1863 if (c1 && (c2 || | |
1864 c3)) | |
1865 foo; | |
1866 if (c1 && | |
1867 (c2 || c3)) | |
1868 { | |
1869 } | |
1870 if (c123456789 | |
1871 && (c22345 | |
1872 || c3)) | |
1873 printf("foo\n"); | |
1874 | |
1875 if ( c1 | |
1876 && ( c2 | |
1877 || c3)) | |
1878 foo; | |
1879 func( c1 | |
1880 && ( c2 | |
1881 || c3)) | |
1882 foo; | |
1883 } | |
1884 | |
1885 STARTTEST | |
1886 :set cino=k2,(s | |
1887 2kdd3j=][ | |
1888 ENDTEST | |
1889 | |
1890 void func(void) | |
1891 { | |
1892 if (condition1 | |
1893 && condition2) | |
1894 action(); | |
1895 function(argument1 | |
1896 && argument2); | |
1897 | |
1898 if (c1 && (c2 || | |
1899 c3)) | |
1900 foo; | |
1901 if (c1 && | |
1902 (c2 || c3)) | |
1903 { | |
1904 } | |
1905 } | |
1906 | |
1907 STARTTEST | |
2857 | 1908 :set cino=N-s |
2879 | 1909 /^NAMESPACESTART |
2857 | 1910 =/^NAMESPACEEND |
1911 ENDTEST | |
1912 | |
2879 | 1913 NAMESPACESTART |
2857 | 1914 /* valid namespaces with normal indent */ |
1915 namespace | |
1916 { | |
1917 { | |
1918 111111111111; | |
1919 } | |
1920 } | |
1921 namespace /* test */ | |
1922 { | |
1923 11111111111111111; | |
1924 } | |
1925 namespace // test | |
1926 { | |
1927 111111111111111111; | |
1928 } | |
1929 namespace | |
1930 { | |
1931 111111111111111111; | |
1932 } | |
1933 namespace test | |
1934 { | |
1935 111111111111111111; | |
1936 } | |
10396
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1937 namespace test::cpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1938 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1939 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1940 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1941 namespace ::incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1942 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1943 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1944 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1945 namespace test::incorrectcpp17:: |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1946 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1947 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1948 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1949 namespace test:incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1950 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1951 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1952 } |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1953 namespace test:::incorrectcpp17 |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1954 { |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1955 111111111111111111; |
0bbbe99c8432
commit https://github.com/vim/vim/commit/ca8b8d6956dd881de6446fc32c38e817a364a6cc
Christian Brabandt <cb@256bit.org>
parents:
7206
diff
changeset
|
1956 } |
2857 | 1957 namespace{ |
1958 111111111111111111; | |
1959 } | |
1960 namespace test{ | |
1961 111111111111111111; | |
1962 } | |
1963 namespace { | |
1964 111111111111111111; | |
1965 } | |
1966 namespace test { | |
1967 111111111111111111; | |
1968 namespace test2 { | |
1969 22222222222222222; | |
1970 } | |
1971 } | |
1972 | |
1973 /* invalid namespaces use block indent */ | |
1974 namespace test test2 { | |
1975 111111111111111111111; | |
1976 } | |
1977 namespace11111111111 { | |
1978 111111111111; | |
1979 } | |
1980 namespace() { | |
1981 1111111111111; | |
1982 } | |
1983 namespace() | |
1984 { | |
1985 111111111111111111; | |
1986 } | |
1987 namespace test test2 | |
1988 { | |
1989 1111111111111111111; | |
1990 } | |
1991 namespace111111111 | |
1992 { | |
1993 111111111111111111; | |
1994 } | |
1995 NAMESPACEEND | |
1996 | |
1997 | |
1998 STARTTEST | |
2968 | 1999 :set cino=j1,J1 |
2879 | 2000 /^JSSTART |
2001 =/^JSEND | |
2002 ENDTEST | |
2003 | |
2004 JSSTART | |
2005 var bar = { | |
2006 foo: { | |
2007 that: this, | |
2008 some: ok, | |
2009 }, | |
2010 "bar":{ | |
2011 a : 2, | |
2012 b: "123abc", | |
2013 x: 4, | |
2014 "y": 5 | |
2015 } | |
2016 } | |
2017 JSEND | |
2018 | |
2019 STARTTEST | |
2968 | 2020 :set cino=j1,J1 |
2021 /^JSSTART | |
2022 =/^JSEND | |
2023 ENDTEST | |
2024 | |
2025 JSSTART | |
2026 var foo = [ | |
6030 | 2027 1, |
2968 | 2028 2, |
2029 3 | |
6030 | 2030 ]; |
2968 | 2031 JSEND |
2032 | |
2033 STARTTEST | |
2034 :set cino=j1,J1 | |
2035 /^JSSTART | |
2036 =/^JSEND | |
2037 ENDTEST | |
2038 | |
2039 JSSTART | |
2040 function bar() { | |
2041 var foo = [ | |
2042 1, | |
2043 2, | |
2044 3 | |
6030 | 2045 ]; |
2968 | 2046 } |
2047 JSEND | |
2048 | |
2049 STARTTEST | |
2050 :set cino=j1,J1 | |
2051 /^JSSTART | |
2052 =/^JSEND | |
2053 ENDTEST | |
2054 | |
2055 JSSTART | |
2056 (function($){ | |
2057 | |
6020 | 2058 if (cond && |
2059 cond) { | |
2060 stmt; | |
2061 } | |
6030 | 2062 window.something.left = |
2063 (width - 50 + offset) + "px"; | |
2968 | 2064 var class_name='myclass'; |
2065 | |
2066 function private_method() { | |
2067 } | |
2068 | |
2069 var public_method={ | |
2070 method: function(options,args){ | |
2071 private_method(); | |
2072 } | |
2073 } | |
2074 | |
2075 function init(options) { | |
2076 | |
2077 $(this).data(class_name+'_public',$.extend({},{ | |
2078 foo: 'bar', | |
6030 | 2079 bar: 2, |
2080 foobar: [ | |
2081 1, | |
2082 2, | |
2083 3 | |
2968 | 2084 ], |
6030 | 2085 callback: function(){ |
2086 return true; | |
2087 } | |
2968 | 2088 }, options||{})); |
2089 } | |
2090 | |
2091 $.fn[class_name]=function() { | |
2092 | |
2093 var _arguments=arguments; | |
2094 return this.each(function(){ | |
2095 | |
2096 var options=$(this).data(class_name+'_public'); | |
2097 if (!options) { | |
2098 init.apply(this,_arguments); | |
2099 | |
2100 } else { | |
2101 var method=public_method[_arguments[0]]; | |
2102 | |
2103 if (typeof(method)!='function') { | |
2104 console.log(class_name+' has no method "'+_arguments[0]+'"'); | |
2105 return false; | |
2106 } | |
2107 _arguments[0]=options; | |
2108 method.apply(this,_arguments); | |
2109 } | |
2110 }); | |
2111 } | |
2112 | |
2113 })(jQuery); | |
2114 JSEND | |
2115 | |
2116 STARTTEST | |
2117 :set cino=j1,J1 | |
2118 /^JSSTART | |
2119 =/^JSEND | |
2120 ENDTEST | |
2121 | |
2122 JSSTART | |
2123 function init(options) { | |
2124 $(this).data(class_name+'_public',$.extend({},{ | |
2125 foo: 'bar', | |
2126 bar: 2, | |
2127 foobar: [ | |
6030 | 2128 1, |
2129 2, | |
2130 3 | |
2968 | 2131 ], |
2132 callback: function(){ | |
2133 return true; | |
2134 } | |
2135 }, options||{})); | |
2136 } | |
2137 JSEND | |
2138 | |
2139 STARTTEST | |
2140 :set cino=j1,J1 | |
2141 /^JSSTART | |
2142 =/^JSEND | |
2143 ENDTEST | |
2144 | |
2145 JSSTART | |
2146 (function($){ | |
2147 function init(options) { | |
2148 $(this).data(class_name+'_public',$.extend({},{ | |
2149 foo: 'bar', | |
6030 | 2150 bar: 2, |
2151 foobar: [ | |
2152 1, | |
2153 2, | |
2154 3 | |
2968 | 2155 ], |
6030 | 2156 callback: function(){ |
2157 return true; | |
2158 } | |
2968 | 2159 }, options||{})); |
2160 } | |
2161 })(jQuery); | |
2162 JSEND | |
2163 | |
2164 STARTTEST | |
6691 | 2165 :set cino=j1,J1,+2 |
2166 /^JSSTART | |
2167 =/^JSEND | |
2168 ENDTEST | |
2169 | |
2170 JSSTART | |
2171 // Results of JavaScript indent | |
2172 // 1 | |
2173 (function(){ | |
2174 var a = [ | |
2175 'a', | |
2176 'b', | |
2177 'c', | |
2178 'd', | |
2179 'e', | |
2180 'f', | |
2181 'g', | |
2182 'h', | |
2183 'i' | |
2184 ]; | |
2185 }()) | |
2186 | |
2187 // 2 | |
2188 (function(){ | |
2189 var a = [ | |
2190 0 + | |
2191 5 * | |
2192 9 * | |
2193 'a', | |
2194 'b', | |
2195 0 + | |
2196 5 * | |
2197 9 * | |
2198 'c', | |
2199 'd', | |
2200 'e', | |
2201 'f', | |
2202 'g', | |
2203 'h', | |
2204 'i' | |
2205 ]; | |
2206 }()) | |
2207 | |
2208 // 3 | |
2209 (function(){ | |
2210 var a = [ | |
2211 0 + | |
2212 // comment 1 | |
2213 5 * | |
2214 /* comment 2 */ | |
2215 9 * | |
2216 'a', | |
2217 'b', | |
2218 0 + | |
2219 5 * | |
2220 9 * | |
2221 'c', | |
2222 'd', | |
2223 'e', | |
2224 'f', | |
2225 'g', | |
2226 'h', | |
2227 'i' | |
2228 ]; | |
2229 }()) | |
2230 | |
2231 // 4 | |
2232 { | |
2233 var a = [ | |
2234 0, | |
2235 1 | |
2236 ]; | |
2237 var b; | |
2238 var c; | |
2239 } | |
2240 | |
2241 // 5 | |
2242 { | |
2243 var a = [ | |
2244 [ | |
2245 0 | |
2246 ], | |
2247 2, | |
2248 3 | |
2249 ]; | |
2250 } | |
2251 | |
2252 // 6 | |
2253 { | |
2254 var a = [ | |
2255 [ | |
2256 0, | |
2257 1 | |
2258 ], | |
2259 2, | |
2260 3 | |
2261 ]; | |
2262 } | |
2263 | |
2264 // 7 | |
2265 { | |
2266 var a = [ | |
2267 // [ | |
2268 0, | |
2269 // 1 | |
2270 // ], | |
2271 2, | |
2272 3 | |
2273 ]; | |
2274 } | |
2275 | |
2276 // 8 | |
2277 var x = [ | |
2278 (function(){ | |
2279 var a, | |
2280 b, | |
2281 c, | |
2282 d, | |
2283 e, | |
2284 f, | |
2285 g, | |
2286 h, | |
2287 i; | |
2288 }) | |
2289 ]; | |
2290 | |
2291 // 9 | |
2292 var a = [ | |
2293 0 + | |
2294 5 * | |
2295 9 * | |
2296 'a', | |
2297 'b', | |
2298 0 + | |
2299 5 * | |
2300 9 * | |
2301 'c', | |
2302 'd', | |
2303 'e', | |
2304 'f', | |
2305 'g', | |
2306 'h', | |
2307 'i' | |
2308 ]; | |
2309 | |
2310 // 10 | |
2311 var a, | |
2312 b, | |
2313 c, | |
2314 d, | |
2315 e, | |
2316 f, | |
2317 g, | |
2318 h, | |
2319 i; | |
2320 JSEND | |
2321 | |
2322 STARTTEST | |
10516
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2323 :set cin cino& |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2324 /start of define |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2325 =/end of define |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2326 ENDTEST |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2327 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2328 /* start of define */ |
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 } |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2331 #define AAA \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2332 BBB\ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2333 CCC |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2334 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2335 #define CNT \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2336 1 + \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2337 2 + \ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2338 4 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2339 /* end of define */ |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2340 |
09bb1836cdb5
commit https://github.com/vim/vim/commit/c6aa475a27e3ed1645446b014c32ebf68d005d49
Christian Brabandt <cb@256bit.org>
parents:
10396
diff
changeset
|
2341 STARTTEST |
7 | 2342 :g/^STARTTEST/.,/^ENDTEST/d |
2343 :1;/start of AUTO/,$wq! test.out | |
2344 ENDTEST |