4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Various problems with 'cindent', among which that a
12 list of variable declarations is not indented properly.
13 Solution: Fix the wrong indenting. Improve indenting of C++ methods.
14 Add the 'i', 'b' and 'W' options to 'cinoptions'. (mostly by
16 Improve indenting of preprocessor-continuation lines.
17 Files: runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in,
21 *** ../vim-6.2.503/runtime/doc/indent.txt Sun Jun 1 12:20:33 2003
22 --- runtime/doc/indent.txt Sun Apr 25 11:57:22 2004
25 ! *indent.txt* For Vim version 6.2. Last change: 2003 May 04
28 VIM REFERENCE MANUAL by Bram Moolenaar
30 ! *indent.txt* For Vim version 6.2. Last change: 2004 Apr 25
33 VIM REFERENCE MANUAL by Bram Moolenaar
38 lN If N != 0 Vim will align with a case label instead of the
42 switch (a) { switch (a) {
46 lN If N != 0 Vim will align with a case label instead of the
47 ! statement after it in the same line.
50 switch (a) { switch (a) {
57 + bN If N != 0 Vim will align a final "break" with the case label,
58 + so that case..break looks like a sort of block. (default: 0).
61 + switch (x) switch(x)
72 gN Place C++ scope declarations N characters from the indent of the
73 block they are in. (default 'shiftwidth'). A scope declaration
74 can be "public:", "protected:" or "private:".
81 + iN Indent C++ base class declarations and contructor
82 + initializations, if they start in a new line (otherwise they
83 + are aligned at the right side of the ':').
84 + (default 'shiftwidth').
87 + class MyClass : class MyClass :
88 + public BaseClass public BaseClass
90 + MyClass::MyClass() : MyClass::MyClass() :
91 + BaseClass(3) BaseClass(3)
94 +N Indent a continuation line (a line that spills onto the next) N
95 additional characters. (default 'shiftwidth').
104 + WN When in unclosed parentheses and N is non-zero and either
105 + using "(0" or "u0", respectively and the unclosed parentheses is
106 + the last non-white character in its line and it is not the
107 + closing parentheses, indent the following line N characters
108 + relative to the outer context (i.e. start of the line or the
109 + next unclosed parentheses). (default: 0).
111 + cino=(0 cino=(0,W4 >
112 + a_long_line( a_long_line(
113 + argument, argument,
114 + argument); argument);
115 + a_short_line(argument, a_short_line(argument,
116 + argument); argument);
118 mN When N is non-zero, line up a line starting with a closing
119 parentheses with the first character of the line with the
120 *** ../vim-6.2.503/src/misc1.c Mon Apr 19 20:26:43 2004
121 --- src/misc1.c Mon Apr 26 18:58:23 2004
124 static char_u *after_label __ARGS((char_u *l));
125 static int get_indent_nolabel __ARGS((linenr_T lnum));
126 static int skip_label __ARGS((linenr_T, char_u **pp, int ind_maxcomment));
127 static int cin_ispreproc __ARGS((char_u *));
128 static int cin_iscomment __ARGS((char_u *));
129 static int cin_islinecomment __ARGS((char_u *));
130 ! static int cin_isterminated __ARGS((char_u *, int));
131 ! static int cin_isfuncdecl __ARGS((char_u *));
132 static int cin_isif __ARGS((char_u *));
133 static int cin_iselse __ARGS((char_u *));
134 static int cin_isdo __ARGS((char_u *));
135 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
136 ! static int cin_ends_in __ARGS((char_u *, char_u *));
137 static int cin_skip2pos __ARGS((pos_T *trypos));
138 static pos_T *find_start_brace __ARGS((int));
139 static pos_T *find_match_paren __ARGS((int, int));
140 ! static int find_last_paren __ARGS((char_u *l));
141 static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
145 static char_u *after_label __ARGS((char_u *l));
146 static int get_indent_nolabel __ARGS((linenr_T lnum));
147 static int skip_label __ARGS((linenr_T, char_u **pp, int ind_maxcomment));
148 + static int cin_first_id_amount __ARGS((void));
149 + static int cin_get_equal_amount __ARGS((linenr_T lnum));
150 static int cin_ispreproc __ARGS((char_u *));
151 + static int cin_ispreproc_cont __ARGS((char_u **pp, linenr_T *lnump));
152 static int cin_iscomment __ARGS((char_u *));
153 static int cin_islinecomment __ARGS((char_u *));
154 ! static int cin_isterminated __ARGS((char_u *, int, int));
155 ! static int cin_isinit __ARGS((void));
156 ! static int cin_isfuncdecl __ARGS((char_u **, linenr_T));
157 static int cin_isif __ARGS((char_u *));
158 static int cin_iselse __ARGS((char_u *));
159 static int cin_isdo __ARGS((char_u *));
160 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
161 ! static int cin_isbreak __ARGS((char_u *));
162 ! static int cin_is_cpp_baseclass __ARGS((char_u *line, colnr_T *col));
163 ! static int cin_ends_in __ARGS((char_u *, char_u *, char_u *));
164 static int cin_skip2pos __ARGS((pos_T *trypos));
165 static pos_T *find_start_brace __ARGS((int));
166 static pos_T *find_match_paren __ARGS((int, int));
167 ! static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
168 ! static int find_last_paren __ARGS((char_u *l, int start, int end));
169 static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
176 curwin->w_cursor = cursor_save;
177 ! if (cin_isterminated(line, TRUE)
178 || cin_isscopedecl(line)
180 || (cin_islabel_skip(&line) && cin_nocode(line)))
184 curwin->w_cursor = cursor_save;
185 ! if (cin_isterminated(line, TRUE, FALSE)
186 || cin_isscopedecl(line)
188 || (cin_islabel_skip(&line) && cin_nocode(line)))
195 + * Recognize structure initialization and enumerations.
196 + * Q&D-Implementation:
197 + * check for "=" at end or "enum" at beginning of line.
204 + s = cin_skipcomment(ml_get_curline());
206 + if (STRNCMP(s, "enum", 4) == 0 && !vim_isIDc(s[4]))
209 + if (cin_ends_in(s, (char_u *)"=", (char_u *)"{"))
216 * Recognize a switch label: "case .*:" or "default:".
225 + * Return the indent of the first variable name after a type in a declaration.
226 + * int a, indent of "a"
227 + * static struct foo b, indent of "b"
228 + * enum bla c, indent of "c"
229 + * Returns zero when it doesn't look like a declaration.
232 + cin_first_id_amount()
234 + char_u *line, *p, *s;
239 + line = ml_get_curline();
240 + p = skipwhite(line);
241 + len = skiptowhite(p) - p;
242 + if (len == 6 && STRNCMP(p, "static", 6) == 0)
244 + p = skipwhite(p + 6);
245 + len = skiptowhite(p) - p;
247 + if (len == 6 && STRNCMP(p, "struct", 6) == 0)
248 + p = skipwhite(p + 6);
249 + else if (len == 4 && STRNCMP(p, "enum", 4) == 0)
250 + p = skipwhite(p + 4);
251 + else if ((len == 8 && STRNCMP(p, "unsigned", 8) == 0)
252 + || (len == 6 && STRNCMP(p, "signed", 6) == 0))
254 + s = skipwhite(p + len);
255 + if ((STRNCMP(s, "int", 3) == 0 && vim_iswhite(s[3]))
256 + || (STRNCMP(s, "long", 4) == 0 && vim_iswhite(s[4]))
257 + || (STRNCMP(s, "short", 5) == 0 && vim_iswhite(s[5]))
258 + || (STRNCMP(s, "char", 4) == 0 && vim_iswhite(s[4])))
261 + for (len = 0; vim_isIDc(p[len]); ++len)
263 + if (len == 0 || !vim_iswhite(p[len]) || cin_nocode(p))
266 + p = skipwhite(p + len);
267 + fp.lnum = curwin->w_cursor.lnum;
268 + fp.col = (colnr_T)(p - line);
269 + getvcol(curwin, &fp, &col, NULL, NULL);
274 + * Return the indent of the first non-blank after an equal sign.
275 + * char *foo = "here";
276 + * Return zero if no (useful) equal sign found.
277 + * Return -1 if the line above "lnum" ends in a backslash.
283 + cin_get_equal_amount(lnum)
293 + line = ml_get(lnum - 1);
294 + if (*line != NUL && line[STRLEN(line) - 1] == '\\')
298 + line = s = ml_get(lnum);
299 + while (*s != NUL && vim_strchr((char_u *)"=;{}\"'", *s) == NULL)
301 + if (cin_iscomment(s)) /* ignore comments */
302 + s = cin_skipcomment(s);
309 + s = skipwhite(s + 1);
313 + if (*s == '"') /* nice alignment for continued strings */
317 + fp.col = (colnr_T)(s - line);
318 + getvcol(curwin, &fp, &col, NULL, NULL);
323 * Recognize a preprocessor statement: Any line that starts with '#'.
332 + * Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
333 + * continuation line of a preprocessor statement. Decrease "*lnump" to the
334 + * start and return the line in "*pp".
337 + cin_ispreproc_cont(pp, lnump)
341 + char_u *line = *pp;
342 + linenr_T lnum = *lnump;
343 + int retval = FALSE;
347 + if (cin_ispreproc(line))
355 + line = ml_get(--lnum);
356 + if (*line == NUL || line[STRLEN(line) - 1] != '\\')
360 + if (lnum != *lnump)
361 + *pp = ml_get(*lnump);
366 * Recognize the start of a C or C++ comment.
372 * Recognize a line that starts with '{' or '}', or ends with ';', '{' or '}'.
373 * Don't consider "} else" a terminated line.
374 ! * Also consider a line terminated if it ends in ','. This is not 100%
375 ! * correct, but this mostly means we are in initializations and then it's OK.
378 ! cin_isterminated(s, incl_open)
380 int incl_open; /* include '{' at the end as terminator */
382 s = cin_skipcomment(s);
384 if (*s == '{' || (*s == '}' && !cin_iselse(s)))
389 /* skip over comments, "" strings and 'c'haracters */
390 s = skip_string(cin_skipcomment(s));
391 ! if ((*s == ';' || (incl_open && *s == '{') || *s == '}' || *s == ',')
392 ! && cin_nocode(s + 1))
401 * Recognize the basic picture of a function declaration -- it needs to
402 * have an open paren somewhere and a close paren at the end of the line and
403 * no semicolons anywhere.
409 while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"')
411 if (cin_iscomment(s)) /* ignore comments */
414 * Recognize a line that starts with '{' or '}', or ends with ';', '{' or '}'.
415 * Don't consider "} else" a terminated line.
416 ! * Return the character terminating the line (ending char's have precedence if
417 ! * both apply in order to determine initializations).
420 ! cin_isterminated(s, incl_open, incl_comma)
422 int incl_open; /* include '{' at the end as terminator */
423 + int incl_comma; /* recognize a trailing comma */
425 + char_u found_start = 0;
427 s = cin_skipcomment(s);
429 if (*s == '{' || (*s == '}' && !cin_iselse(s)))
434 /* skip over comments, "" strings and 'c'haracters */
435 s = skip_string(cin_skipcomment(s));
436 ! if ((*s == ';' || (incl_open && *s == '{') || *s == '}'
437 ! || (incl_comma && *s == ','))
438 ! && cin_nocode(s + 1))
444 ! return found_start;
448 * Recognize the basic picture of a function declaration -- it needs to
449 * have an open paren somewhere and a close paren at the end of the line and
450 * no semicolons anywhere.
451 + * When a line ends in a comma we continue looking in the next line.
452 + * "sp" points to a string with the line. When looking at other lines it must
453 + * be restored to the line. When it's NULL fetch lines here.
454 + * "lnum" is where we start looking.
457 ! cin_isfuncdecl(sp, first_lnum)
459 ! linenr_T first_lnum;
462 + linenr_T lnum = first_lnum;
463 + int retval = FALSE;
470 while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"')
472 if (cin_iscomment(s)) /* ignore comments */
475 while (*s && *s != ';' && *s != '\'' && *s != '"')
477 if (*s == ')' && cin_nocode(s + 1))
479 ! if (cin_iscomment(s)) /* ignore comments */
480 s = cin_skipcomment(s);
489 while (*s && *s != ';' && *s != '\'' && *s != '"')
491 if (*s == ')' && cin_nocode(s + 1))
493 ! /* ')' at the end: may have found a match
494 ! * Check for he previous line not to end in a backslash:
495 ! * #if defined(x) && \
498 ! lnum = first_lnum - 1;
500 ! if (*s == NUL || s[STRLEN(s) - 1] != '\\')
504 ! if (*s == ',' && cin_nocode(s + 1))
506 ! /* ',' at the end: continue looking in the next line */
507 ! if (lnum >= curbuf->b_ml.ml_line_count)
510 ! s = ml_get(++lnum);
512 ! else if (cin_iscomment(s)) /* ignore comments */
513 s = cin_skipcomment(s);
519 ! if (lnum != first_lnum && sp != NULL)
520 ! *sp = ml_get(first_lnum);
532 * Return TRUE if string "s" ends with the string "find", possibly followed by
533 * white space and comments. Skip strings and comments.
536 ! cin_ends_in(s, find)
550 + return (STRNCMP(p, "break", 5) == 0 && !vim_isIDc(p[5]));
553 + /* Find the position of a C++ base-class declaration or
554 + * constructor-initialization. eg:
557 + * baseClass <-- here
558 + * class MyClass : public baseClass,
559 + * anotherBaseClass <-- here (should probably lineup ??)
560 + * MyClass::MyClass(...) :
561 + * baseClass(...) <-- here (constructor-initialization)
564 + cin_is_cpp_baseclass(line, col)
569 + int class_or_struct, lookfor_ctor_init, cpp_base_class;
573 + s = cin_skipcomment(line);
577 + cpp_base_class = lookfor_ctor_init = class_or_struct = FALSE;
585 + /* skip double colon. It can't be a constructor
586 + * initialization any more */
587 + lookfor_ctor_init = FALSE;
588 + s = cin_skipcomment(s + 2);
590 + else if (lookfor_ctor_init || class_or_struct)
592 + /* we have something found, that looks like the start of
593 + * cpp-base-class-declaration or contructor-initialization */
594 + cpp_base_class = TRUE;
595 + lookfor_ctor_init = class_or_struct = FALSE;
597 + s = cin_skipcomment(s + 1);
600 + s = cin_skipcomment(s + 1);
602 + else if ((STRNCMP(s, "class", 5) == 0 && !vim_isIDc(s[5]))
603 + || (STRNCMP(s, "struct", 6) == 0 && !vim_isIDc(s[6])))
605 + class_or_struct = TRUE;
606 + lookfor_ctor_init = FALSE;
609 + s = cin_skipcomment(s + 5);
611 + s = cin_skipcomment(s + 6);
615 + if (s[0] == '{' || s[0] == '}' || s[0] == ';')
617 + cpp_base_class = lookfor_ctor_init = class_or_struct = FALSE;
619 + else if (s[0] == ')')
621 + /* Constructor-initialization is assumed if we come across
622 + * something like "):" */
623 + class_or_struct = FALSE;
624 + lookfor_ctor_init = TRUE;
626 + else if (!vim_isIDc(s[0]))
628 + /* if it is not an identifier, we are wrong */
629 + class_or_struct = FALSE;
630 + lookfor_ctor_init = FALSE;
632 + else if (*col == 0)
634 + /* it can't be a constructor-initialization any more */
635 + lookfor_ctor_init = FALSE;
637 + /* the first statement starts here: lineup with this one... */
638 + if (cpp_base_class && *col == 0)
639 + *col = (colnr_T)(s - line);
642 + s = cin_skipcomment(s + 1);
646 + return cpp_base_class;
650 * Return TRUE if string "s" ends with the string "find", possibly followed by
651 * white space and comments. Skip strings and comments.
652 + * Ignore "ignore" after "find" if it's not NULL.
655 ! cin_ends_in(s, find, ignore)
664 if (STRNCMP(p, find, len) == 0)
666 r = skipwhite(p + len);
667 ! if (*r == NUL || cin_iscomment(r))
672 if (STRNCMP(p, find, len) == 0)
674 r = skipwhite(p + len);
675 ! if (ignore != NULL && STRNCMP(r, ignore, STRLEN(ignore)) == 0)
676 ! r = skipwhite(r + STRLEN(ignore));
686 ! * Set w_cursor.col to the column number of the last ')' in line "l".
693 ! int retval = FALSE;
695 curwin->w_cursor.col = 0; /* default is start of line */
697 for (i = 0; l[i]; i++)
699 i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */
702 ! curwin->w_cursor.col = i;
711 ! * Return ind_maxparen corrected for the difference in line number between the
712 ! * cursor position and "startpos". This makes sure that searching for a
713 ! * matching paren above the cursor line doesn't find a match because of
714 ! * looking a few lines further.
717 ! corr_ind_maxparen(ind_maxparen, startpos)
721 ! long n = (long)startpos->lnum - (long)curwin->w_cursor.lnum;
723 ! if (n > 0 && n < ind_maxparen / 2)
724 ! return ind_maxparen - (int)n;
725 ! return ind_maxparen;
729 ! * Set w_cursor.col to the column number of the last unmatched ')' or '{' in
733 ! find_last_paren(l, start, end)
738 ! int retval = FALSE;
739 ! int open_count = 0;
741 curwin->w_cursor.col = 0; /* default is start of line */
743 for (i = 0; l[i]; i++)
745 + i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
746 i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */
749 ! else if (l[i] == end)
751 ! if (open_count > 0)
755 ! curwin->w_cursor.col = i;
764 int ind_case_code = curbuf->b_p_sw;
767 + * lineup break at end of case in switch() with case label
769 + int ind_case_break = 0;
772 * spaces from the class declaration indent a scope declaration label
778 int ind_func_type = curbuf->b_p_sw;
781 + * amount a cpp base class declaration or constructor initialization
782 + * should be indented
784 + int ind_cpp_baseclass = curbuf->b_p_sw;
787 * additional spaces beyond the prevailing indent a continuation line
793 int ind_unclosed_noignore = 0;
796 + * If the opening paren is the last nonwhite character on the line, and
797 + * ind_unclosed_wrapped is nonzero, use this indent relative to the outer
798 + * context (for very long lines).
800 + int ind_unclosed_wrapped = 0;
803 * suppress ignoring white space when lining up with the character after
804 * an unclosed parentheses.
814 + #define LOOKFOR_INITIAL 0
817 #define LOOKFOR_CASE 3
821 #define LOOKFOR_TERM 5
822 #define LOOKFOR_UNTERM 6
823 #define LOOKFOR_SCOPEDECL 7
824 + #define LOOKFOR_NOBREAK 8
825 + #define LOOKFOR_CPP_BASECLASS 9
826 + #define LOOKFOR_ENUM_OR_INIT 10
838 + int cont_amount = 0; /* amount for continuation line */
840 for (options = curbuf->b_p_cino; *options; )
845 case '^': ind_open_left_imag = n; break;
846 case ':': ind_case = n; break;
847 case '=': ind_case_code = n; break;
848 + case 'b': ind_case_break = n; break;
849 case 'p': ind_param = n; break;
850 case 't': ind_func_type = n; break;
851 case '/': ind_comment = n; break;
852 case 'c': ind_in_comment = n; break;
853 case 'C': ind_in_comment2 = n; break;
854 + case 'i': ind_cpp_baseclass = n; break;
855 case '+': ind_continuation = n; break;
856 case '(': ind_unclosed = n; break;
857 case 'u': ind_unclosed2 = n; break;
858 case 'U': ind_unclosed_noignore = n; break;
859 + case 'W': ind_unclosed_wrapped = n; break;
860 case 'w': ind_unclosed_whiteok = n; break;
861 case 'm': ind_matching_paren = n; break;
862 case ')': ind_maxparen = n; break;
865 * a previous non-empty line that matches the same paren.
868 our_paren_pos = *trypos;
869 ! if (theline[0] != ')')
871 ! for (lnum = cur_curpos.lnum - 1; lnum > our_paren_pos.lnum; --lnum)
873 ! l = skipwhite(ml_get(lnum));
874 ! if (cin_nocode(l)) /* skip comment lines */
876 ! if (cin_ispreproc(l)) /* ignore #defines, #if, etc. */
878 ! curwin->w_cursor.lnum = lnum;
880 ! /* Skip a comment. XXX */
881 ! if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
883 ! lnum = trypos->lnum + 1;
888 ! if ((trypos = find_match_paren(ind_maxparen,
889 ! ind_maxcomment)) != NULL &&
890 ! trypos->lnum == our_paren_pos.lnum &&
891 ! trypos->col == our_paren_pos.col)
893 amount = get_indent_lnum(lnum); /* XXX */
900 * a previous non-empty line that matches the same paren.
903 + cur_amount = MAXCOL;
904 our_paren_pos = *trypos;
905 ! for (lnum = cur_curpos.lnum - 1; lnum > our_paren_pos.lnum; --lnum)
907 ! l = skipwhite(ml_get(lnum));
908 ! if (cin_nocode(l)) /* skip comment lines */
910 ! if (cin_ispreproc_cont(&l, &lnum)) /* ignore #defines, #if, etc. */
912 ! curwin->w_cursor.lnum = lnum;
914 ! /* Skip a comment. XXX */
915 ! if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
917 ! lnum = trypos->lnum + 1;
922 ! if ((trypos = find_match_paren(
923 ! corr_ind_maxparen(ind_maxparen, &cur_curpos),
924 ! ind_maxcomment)) != NULL
925 ! && trypos->lnum == our_paren_pos.lnum
926 ! && trypos->col == our_paren_pos.col)
928 amount = get_indent_lnum(lnum); /* XXX */
930 ! if (theline[0] == ')')
932 ! if (our_paren_pos.lnum != lnum && cur_amount > amount)
933 ! cur_amount = amount;
944 amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
945 - cur_amount = MAXCOL;
946 if (theline[0] == ')' || ind_unclosed == 0
947 || (!ind_unclosed_noignore && *skipwhite(look) == '('))
950 * If we're looking at a close paren, line up right there;
951 * otherwise, line up with the next (non-white) character.
953 if (theline[0] != ')')
955 ! if (ind_unclosed_whiteok)
959 col = our_paren_pos.col + 1;
960 - l = ml_get(our_paren_pos.lnum);
961 while (vim_iswhite(l[col]))
963 if (l[col] != NUL) /* In case of trailing space */
967 amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
968 if (theline[0] == ')' || ind_unclosed == 0
969 || (!ind_unclosed_noignore && *skipwhite(look) == '('))
972 * If we're looking at a close paren, line up right there;
973 * otherwise, line up with the next (non-white) character.
974 + * When ind_unclosed_wrapped is set and the matching paren is
975 + * the last nonwhite character of the line, use either the
976 + * indent of the current line or the indentation of the next
977 + * outer paren and add ind_unclosed_wrapped (for very long
980 if (theline[0] != ')')
982 ! cur_amount = MAXCOL;
983 ! l = ml_get(our_paren_pos.lnum);
984 ! if (ind_unclosed_wrapped
985 ! && cin_ends_in(l, (char_u *)"(", NULL))
987 ! /* look for opening unmatched paren, indent one level
988 ! * for each additional level */
990 ! for (col = 0; col < our_paren_pos.col; ++col)
999 ! case '}': if (n > 1)
1005 ! our_paren_pos.col = 0;
1006 ! amount += n * ind_unclosed_wrapped;
1008 ! else if (ind_unclosed_whiteok)
1009 our_paren_pos.col++;
1012 col = our_paren_pos.col + 1;
1013 while (vim_iswhite(l[col]))
1015 if (l[col] != NUL) /* In case of trailing space */
1018 * Find how indented the paren is, or the character after it
1019 * if we did the above "if".
1021 ! getvcol(curwin, &our_paren_pos, &col, NULL, NULL);
1025 if (theline[0] == ')' && ind_matching_paren)
1027 * Find how indented the paren is, or the character after it
1028 * if we did the above "if".
1030 ! if (our_paren_pos.col > 0)
1032 ! getvcol(curwin, &our_paren_pos, &col, NULL, NULL);
1033 ! if (cur_amount > (int)col)
1038 if (theline[0] == ')' && ind_matching_paren)
1042 else if (ind_unclosed == 0 || (!ind_unclosed_noignore
1043 && *skipwhite(look) == '('))
1044 ! amount = cur_amount;
1047 /* add ind_unclosed2 for each '(' before our matching one */
1050 else if (ind_unclosed == 0 || (!ind_unclosed_noignore
1051 && *skipwhite(look) == '('))
1053 ! if (cur_amount != MAXCOL)
1054 ! amount = cur_amount;
1058 /* add ind_unclosed2 for each '(' before our matching one */
1061 * matching it will take us back to the start of the line.
1064 ! if (find_last_paren(start) &&
1065 ! (trypos = find_match_paren(ind_maxparen,
1066 ind_maxcomment)) != NULL)
1067 lnum = trypos->lnum;
1070 * matching it will take us back to the start of the line.
1073 ! if (find_last_paren(start, '(', ')')
1074 ! && (trypos = find_match_paren(ind_maxparen,
1075 ind_maxcomment)) != NULL)
1076 lnum = trypos->lnum;
1080 * If we're looking at a "while", try to find a "do"
1084 if (cin_iselse(theline))
1085 lookfor = LOOKFOR_IF;
1086 else if (cin_iswhileofdo(theline, cur_curpos.lnum, ind_maxparen))
1088 lookfor = LOOKFOR_DO;
1091 curwin->w_cursor.lnum = cur_curpos.lnum;
1092 if (find_match(lookfor, ourscope, ind_maxparen,
1094 * If we're looking at a "while", try to find a "do"
1097 ! lookfor = LOOKFOR_INITIAL;
1098 if (cin_iselse(theline))
1099 lookfor = LOOKFOR_IF;
1100 else if (cin_iswhileofdo(theline, cur_curpos.lnum, ind_maxparen))
1102 lookfor = LOOKFOR_DO;
1103 ! if (lookfor != LOOKFOR_INITIAL)
1105 curwin->w_cursor.lnum = cur_curpos.lnum;
1106 if (find_match(lookfor, ourscope, ind_maxparen,
1113 + lookfor_break = FALSE;
1115 if (cin_iscase(theline)) /* it's a switch() label */
1117 lookfor = LOOKFOR_CASE; /* find a previous switch() label */
1123 ! lookfor = LOOKFOR_ANY;
1124 amount += ind_level; /* ind_level from start of block */
1126 scope_amount = amount;
1131 ! if (ind_case_break && cin_isbreak(theline)) /* break; ... */
1132 ! lookfor_break = TRUE;
1134 ! lookfor = LOOKFOR_INITIAL;
1135 amount += ind_level; /* ind_level from start of block */
1137 scope_amount = amount;
1141 if (curwin->w_cursor.lnum <= ourscope)
1143 ! if (lookfor == LOOKFOR_UNTERM)
1144 ! amount += ind_continuation;
1145 ! else if (lookfor != LOOKFOR_TERM)
1147 amount = scope_amount;
1148 if (theline[0] == '{')
1151 if (curwin->w_cursor.lnum <= ourscope)
1153 ! /* we reached end of scope:
1154 ! * if looking for a enum or structure initialization
1155 ! * go further back:
1156 ! * if it is an initializer (enum xxx or xxx =), then
1157 ! * don't add ind_continuation, otherwise it is a variable
1160 ! * here; <-- add ind_continuation
1162 ! if (lookfor == LOOKFOR_ENUM_OR_INIT)
1164 ! if (curwin->w_cursor.lnum == 0
1165 ! || curwin->w_cursor.lnum
1166 ! < ourscope - ind_maxparen)
1168 ! /* nothing found (abuse ind_maxparen as limit)
1169 ! * assume terminated line (i.e. a variable
1170 ! * initialization) */
1171 ! if (cont_amount > 0)
1172 ! amount = cont_amount;
1174 ! amount += ind_continuation;
1178 ! l = ml_get_curline();
1181 ! * If we're in a comment now, skip to the start of the
1184 ! trypos = find_start_comment(ind_maxcomment);
1185 ! if (trypos != NULL)
1187 ! curwin->w_cursor.lnum = trypos->lnum + 1;
1192 ! * Skip preprocessor directives and blank lines.
1194 ! if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
1197 ! if (cin_nocode(l))
1201 ! * If we are at top level and the line looks like a
1202 ! * function declaration, we are done
1203 ! * (it's a variable declaration).
1205 ! if (start_brace != BRACE_IN_COL0
1206 ! || !cin_isfuncdecl(&l, curwin->w_cursor.lnum))
1208 ! terminated = cin_isterminated(l, FALSE, TRUE);
1210 ! /* if the line is terminated with another ','
1211 ! * it is a continued variable initialization.
1212 ! * don't add extra indent.
1213 ! * TODO: does not work, if a function
1214 ! * declaration is split over multiple lines:
1215 ! * cin_isfuncdecl returns FALSE then.
1217 ! if (terminated == ',')
1220 ! /* if it es a enum declaration or an assignment,
1223 ! if (terminated != ';' && cin_isinit())
1226 ! /* nothing useful found */
1227 ! if (terminated == 0 || terminated == '{')
1231 ! /* Skip parens and braces. Position the cursor over
1232 ! * the rightmost paren, so that matching it will take
1233 ! * us back to the start of the line.
1236 ! if (find_last_paren(l, '(', ')'))
1237 ! trypos = find_match_paren(ind_maxparen,
1240 ! if (trypos == NULL && find_last_paren(l, '{', '}'))
1241 ! trypos = find_start_brace(ind_maxcomment);
1243 ! if (trypos != NULL)
1245 ! curwin->w_cursor.lnum = trypos->lnum + 1;
1249 ! /* it's a variable declaration, add indentation
1254 ! if (cont_amount > 0)
1255 ! amount = cont_amount;
1257 ! amount += ind_continuation;
1259 ! else if (lookfor == LOOKFOR_UNTERM)
1261 ! if (cont_amount > 0)
1262 ! amount = cont_amount;
1264 ! amount += ind_continuation;
1266 ! else if (lookfor != LOOKFOR_TERM
1267 ! && lookfor != LOOKFOR_CPP_BASECLASS)
1269 amount = scope_amount;
1270 if (theline[0] == '{')
1274 iscase = cin_iscase(l);
1275 if (iscase || cin_isscopedecl(l))
1277 + /* we are only looking for cpp base class
1278 + * declaration/initialization any longer */
1279 + if (lookfor == LOOKFOR_CPP_BASECLASS)
1282 /* When looking for a "do" we are not interested in
1287 * c = 99 + <- this indent plus continuation
1290 ! if (lookfor == LOOKFOR_UNTERM)
1292 ! amount += ind_continuation;
1297 * c = 99 + <- this indent plus continuation
1300 ! if (lookfor == LOOKFOR_UNTERM
1301 ! || lookfor == LOOKFOR_ENUM_OR_INIT)
1303 ! if (cont_amount > 0)
1304 ! amount = cont_amount;
1306 ! amount += ind_continuation;
1315 if ( (iscase && lookfor == LOOKFOR_CASE)
1316 + || (iscase && lookfor_break)
1317 || (!iscase && lookfor == LOOKFOR_SCOPEDECL))
1334 ! if (!lookfor_break)
1342 scope_amount = get_indent() + (iscase /* XXX */
1343 ? ind_case_code : ind_scopedecl_code);
1344 ! lookfor = LOOKFOR_ANY;
1349 * Looking for a switch() label or C++ scope declaration,
1350 ! * ignore other lines.
1352 if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL)
1356 * Ignore jump labels with nothing after them.
1359 scope_amount = get_indent() + (iscase /* XXX */
1360 ? ind_case_code : ind_scopedecl_code);
1361 ! lookfor = ind_case_break ? LOOKFOR_NOBREAK : LOOKFOR_ANY;
1366 * Looking for a switch() label or C++ scope declaration,
1367 ! * ignore other lines, skip {}-blocks.
1369 if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL)
1371 + if (find_last_paren(l, '{', '}') && (trypos =
1372 + find_start_brace(ind_maxcomment)) != NULL)
1373 + curwin->w_cursor.lnum = trypos->lnum + 1;
1378 * Ignore jump labels with nothing after them.
1383 l = ml_get_curline();
1384 ! if (cin_ispreproc(l) || cin_nocode(l))
1388 * What happens next depends on the line being terminated.
1390 ! if (!cin_isterminated(l, FALSE))
1393 * if we're in the middle of a paren thing,
1397 l = ml_get_curline();
1398 ! if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum)
1403 + * Are we at the start of a cpp base class declaration or
1404 + * constructor initialization?
1406 + if (lookfor != LOOKFOR_TERM && ind_cpp_baseclass
1407 + && cin_is_cpp_baseclass(l, &col))
1409 + if (lookfor == LOOKFOR_UNTERM)
1411 + if (cont_amount > 0)
1412 + amount = cont_amount;
1414 + amount += ind_continuation;
1416 + else if (col == 0 || theline[0] == '{')
1418 + amount = get_indent();
1419 + if (find_last_paren(l, '(', ')')
1420 + && (trypos = find_match_paren(ind_maxparen,
1421 + ind_maxcomment)) != NULL)
1422 + amount = get_indent_lnum(trypos->lnum); /* XXX */
1423 + if (theline[0] != '{')
1424 + amount += ind_cpp_baseclass;
1428 + curwin->w_cursor.col = col;
1429 + getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL);
1430 + amount = (int)col;
1434 + else if (lookfor == LOOKFOR_CPP_BASECLASS)
1436 + /* only look, whether there is a cpp base class
1437 + * declaration or initialization before the opening brace. */
1438 + if (cin_isterminated(l, TRUE, FALSE))
1445 * What happens next depends on the line being terminated.
1446 + * If terminated with a ',' only consider it terminating if
1447 + * there is anoter unterminated statement behind, eg:
1451 + * Otherwise check whether it is a enumeration or structure
1452 + * initialisation (not indented) or a variable declaration
1455 ! terminated = cin_isterminated(l, FALSE, TRUE);
1457 ! if (terminated == 0 || (lookfor != LOOKFOR_UNTERM
1458 ! && terminated == ','))
1461 * if we're in the middle of a paren thing,
1464 * position the cursor over the rightmost paren, so that
1465 * matching it will take us back to the start of the line.
1467 ! (void)find_last_paren(l);
1468 ! if ((trypos = find_match_paren(ind_maxparen,
1469 ! ind_maxcomment)) != NULL)
1472 * Check if we are on a case label now. This is
1474 * position the cursor over the rightmost paren, so that
1475 * matching it will take us back to the start of the line.
1477 ! (void)find_last_paren(l, '(', ')');
1478 ! trypos = find_match_paren(
1479 ! corr_ind_maxparen(ind_maxparen, &cur_curpos),
1483 ! * If we are looking for ',', we also look for matching
1486 ! if (trypos == NULL && find_last_paren(l, '{', '}'))
1487 ! trypos = find_start_brace(ind_maxcomment);
1489 ! if (trypos != NULL)
1492 * Check if we are on a case label now. This is
1499 + * Skip over continuation lines to find the one to get the
1501 + * char *usethis = "bla\
1505 + if (terminated == ',')
1507 + while (curwin->w_cursor.lnum > 1)
1509 + l = ml_get(curwin->w_cursor.lnum - 1);
1510 + if (*l == NUL || l[STRLEN(l) - 1] != '\\')
1512 + --curwin->w_cursor.lnum;
1517 * Get indent and pointer to text for current line,
1518 * ignoring any jump label. XXX
1525 ! if (lookfor != LOOKFOR_TERM && theline[0] == '{')
1527 amount = cur_amount;
1533 ! if (terminated != ',' && lookfor != LOOKFOR_TERM
1534 ! && theline[0] == '{')
1536 amount = cur_amount;
1542 if (*skipwhite(l) != '{')
1543 amount += ind_open_extra;
1545 + if (ind_cpp_baseclass)
1547 + /* have to look back, whether it is a cpp base
1548 + * class declaration or initialization */
1549 + lookfor = LOOKFOR_CPP_BASECLASS;
1560 ! if (lookfor == LOOKFOR_UNTERM)
1562 ! amount += ind_continuation;
1570 ! if (lookfor == LOOKFOR_UNTERM
1571 ! || lookfor == LOOKFOR_ENUM_OR_INIT)
1573 ! if (cont_amount > 0)
1574 ! amount = cont_amount;
1576 ! amount += ind_continuation;
1584 if (lookfor == LOOKFOR_UNTERM)
1588 ! * Found first unterminated line on a row, may line up
1589 ! * with this line, remember its indent
1593 ! amount = cur_amount;
1594 ! if (lookfor != LOOKFOR_TERM)
1595 ! lookfor = LOOKFOR_UNTERM;
1602 if (lookfor == LOOKFOR_UNTERM)
1604 + /* When line ends in a comma add extra indent */
1605 + if (terminated == ',')
1606 + amount += ind_continuation;
1610 ! if (lookfor == LOOKFOR_ENUM_OR_INIT)
1612 ! /* Found two lines ending in ',', lineup with the
1613 ! * lowest one, but check for cpp base class
1614 ! * declaration/initialization, if it is an
1615 ! * opening brace or we are looking just for
1616 ! * enumerations/initializations. */
1617 ! if (terminated == ',')
1619 ! if (ind_cpp_baseclass == 0)
1622 ! lookfor = LOOKFOR_CPP_BASECLASS;
1626 ! /* Ignore unterminated lines in between, but
1627 ! * reduce indent. */
1628 ! if (amount > cur_amount)
1629 ! amount = cur_amount;
1634 ! * Found first unterminated line on a row, may
1635 ! * line up with this line, remember its indent
1639 ! amount = cur_amount;
1642 ! * If previous line ends in ',', check whether we
1643 ! * are in an initialization or enum
1648 ! * or a normal possible continuation line.
1649 ! * but only, of no other statement has been found
1652 ! if (lookfor == LOOKFOR_INITIAL && terminated == ',')
1654 ! lookfor = LOOKFOR_ENUM_OR_INIT;
1655 ! cont_amount = cin_first_id_amount();
1659 ! if (lookfor == LOOKFOR_INITIAL
1661 ! && l[STRLEN(l) - 1] == '\\')
1663 ! cont_amount = cin_get_equal_amount(
1664 ! curwin->w_cursor.lnum);
1665 ! if (lookfor != LOOKFOR_TERM)
1666 ! lookfor = LOOKFOR_UNTERM;
1674 * 100 + <- line up with this one
1677 ! if (lookfor == LOOKFOR_UNTERM)
1679 ! amount += ind_continuation;
1684 * 100 + <- line up with this one
1687 ! if (lookfor == LOOKFOR_UNTERM
1688 ! || lookfor == LOOKFOR_ENUM_OR_INIT)
1690 ! if (cont_amount > 0)
1691 ! amount = cont_amount;
1693 ! amount += ind_continuation;
1703 + * Skip single break line, if before a switch label. It
1704 + * may be lined up with the case label.
1706 + if (lookfor == LOOKFOR_NOBREAK
1707 + && cin_isbreak(skipwhite(ml_get_curline())))
1709 + lookfor = LOOKFOR_ANY;
1714 * Handle "do {" line.
1723 ! if (lookfor == LOOKFOR_UNTERM)
1725 ! amount += ind_continuation;
1738 ! if (lookfor == LOOKFOR_UNTERM
1739 ! || lookfor == LOOKFOR_ENUM_OR_INIT)
1741 ! if (cont_amount > 0)
1742 ! amount = cont_amount;
1744 ! amount += ind_continuation;
1751 if (lookfor == LOOKFOR_TERM)
1753 ! if (whilelevel == 0)
1759 if (lookfor == LOOKFOR_TERM)
1761 ! if (!lookfor_break && whilelevel == 0)
1769 l = ml_get_curline();
1770 ! if (find_last_paren(l) &&
1771 ! (trypos = find_match_paren(ind_maxparen,
1772 ind_maxcomment)) != NULL)
1778 l = ml_get_curline();
1779 ! if (find_last_paren(l, '(', ')')
1780 ! && (trypos = find_match_paren(ind_maxparen,
1781 ind_maxcomment)) != NULL)
1787 else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
1788 && !cin_nocode(theline)
1789 ! && cin_isfuncdecl(ml_get(cur_curpos.lnum + 1))
1790 ! && !cin_isterminated(theline, FALSE))
1792 amount = ind_func_type;
1796 else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
1797 && !cin_nocode(theline)
1798 ! && !cin_ends_in(theline, (char_u *)":", NULL)
1799 ! && !cin_ends_in(theline, (char_u *)",", NULL)
1800 ! && cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
1801 ! && !cin_isterminated(theline, FALSE, TRUE))
1803 amount = ind_func_type;
1810 * If the line looks like a function declaration, and we're
1811 * not in a comment, put it the left margin.
1813 ! if (cin_isfuncdecl(theline))
1817 * Finding the closing '}' of a previous function. Put
1822 + * Are we at the start of a cpp base class declaration or constructor
1825 + if (ind_cpp_baseclass != 0 && theline[0] != '{'
1826 + && cin_is_cpp_baseclass(l, &col))
1830 + amount = get_indent() + ind_cpp_baseclass; /* XXX */
1831 + if (find_last_paren(l, '(', ')')
1832 + && (trypos = find_match_paren(ind_maxparen,
1833 + ind_maxcomment)) != NULL)
1834 + amount = get_indent_lnum(trypos->lnum)
1835 + + ind_cpp_baseclass; /* XXX */
1839 + curwin->w_cursor.col = col;
1840 + getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL);
1841 + amount = (int)col;
1847 + * Skip preprocessor directives and blank lines.
1849 + if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
1852 + if (cin_nocode(l))
1856 + * If the previous line ends in ',', use one level of
1860 + * do this before checking for '}' in case of eg.
1868 + if (cin_ends_in(l, (char_u *)",", NULL)
1869 + || (*l != NUL && (n = l[STRLEN(l) - 1]) == '\\'))
1871 + /* take us back to opening paren */
1872 + if (find_last_paren(l, '(', ')')
1873 + && (trypos = find_match_paren(ind_maxparen,
1874 + ind_maxcomment)) != NULL)
1875 + curwin->w_cursor.lnum = trypos->lnum;
1877 + /* For a line ending in ',' that is a continuation line go
1878 + * back to the first line with a backslash:
1879 + * char *foo = "bla\
1883 + while (n == 0 && curwin->w_cursor.lnum > 1)
1885 + l = ml_get(curwin->w_cursor.lnum - 1);
1886 + if (*l == NUL || l[STRLEN(l) - 1] != '\\')
1888 + --curwin->w_cursor.lnum;
1891 + amount = get_indent(); /* XXX */
1894 + amount = cin_first_id_amount();
1896 + amount = ind_continuation;
1901 * If the line looks like a function declaration, and we're
1902 * not in a comment, put it the left margin.
1904 ! if (cin_isfuncdecl(NULL, cur_curpos.lnum)) /* XXX */
1906 + l = ml_get_curline();
1909 * Finding the closing '}' of a previous function. Put
1912 * char *string_array[] = { "foo",
1913 * / * x * / "b};ar" }; / * foobar * /
1915 ! if (cin_ends_in(l, (char_u *)"};"))
1919 - * Skip preprocessor directives and blank lines.
1921 - if (cin_ispreproc(l))
1924 - if (cin_nocode(l))
1928 * If the PREVIOUS line is a function declaration, the current
1929 * line (and the ones that follow) needs to be indented as
1932 ! if (cin_isfuncdecl(l))
1937 * char *string_array[] = { "foo",
1938 * / * x * / "b};ar" }; / * foobar * /
1940 ! if (cin_ends_in(l, (char_u *)"};", NULL))
1944 * If the PREVIOUS line is a function declaration, the current
1945 * line (and the ones that follow) needs to be indented as
1948 ! if (cin_isfuncdecl(&l, curwin->w_cursor.lnum))
1957 ! if (cin_ends_in(l, (char_u*)";"))
1959 l = ml_get(curwin->w_cursor.lnum - 1);
1960 ! if (cin_ends_in(l, (char_u *)",")
1961 || (*l != NUL && l[STRLEN(l) - 1] == '\\'))
1963 l = ml_get_curline();
1967 - * If the previous line ends in ',', use one level of
1972 - if (cin_ends_in(l, (char_u *)",")
1973 - || (*l != NUL && l[STRLEN(l) - 1] == '\\'))
1975 - amount = get_indent();
1977 - amount = ind_param;
1982 * Doesn't look like anything interesting -- so just
1983 * use the indent of this line.
1985 * Position the cursor over the rightmost paren, so that
1986 * matching it will take us back to the start of the line.
1988 ! find_last_paren(l);
1990 if ((trypos = find_match_paren(ind_maxparen,
1991 ind_maxcomment)) != NULL)
1996 ! if (cin_ends_in(l, (char_u*)";", NULL))
1998 l = ml_get(curwin->w_cursor.lnum - 1);
1999 ! if (cin_ends_in(l, (char_u *)",", NULL)
2000 || (*l != NUL && l[STRLEN(l) - 1] == '\\'))
2002 l = ml_get_curline();
2006 * Doesn't look like anything interesting -- so just
2007 * use the indent of this line.
2009 * Position the cursor over the rightmost paren, so that
2010 * matching it will take us back to the start of the line.
2012 ! find_last_paren(l, '(', ')');
2014 if ((trypos = find_match_paren(ind_maxparen,
2015 ind_maxcomment)) != NULL)
2019 /* add extra indent for a comment */
2020 if (cin_iscomment(theline))
2021 amount += ind_comment;
2023 + /* add extra indent if the previous line ended in a backslash:
2026 + * char *foo = "asdf\
2029 + if (cur_curpos.lnum > 1)
2031 + l = ml_get(cur_curpos.lnum - 1);
2032 + if (*l != NUL && l[STRLEN(l) - 1] == '\\')
2034 + cur_amount = cin_get_equal_amount(cur_curpos.lnum - 1);
2035 + if (cur_amount > 0)
2036 + amount = cur_amount;
2037 + else if (cur_amount == 0)
2038 + amount += ind_continuation;
2044 *** ../vim-6.2.503/src/testdir/test3.in Sun May 4 13:29:30 2003
2045 --- src/testdir/test3.in Mon Apr 26 16:56:42 2004
2052 + char *a[] = {"aaa", "bbb",
2056 char *tab[] = {"aaa",
2057 "xx", /* xx */}; /* asdf */
2065 + #if defined(foo) \
2072 + char *foo = "asdf\
2079 + #if defined(foo) \
2081 + char *foo = "asdf\
2087 + char *foo = "asdf\
2102 + Constructor(int a,
2103 + int b ) : BaseClass(a)
2116 + static unsigned sdf,
2118 + unsigned int piet,
2131 + Constructor::Constructor(int a,
2141 + Constructor::Constructor(int a,
2147 + Constructor::Constructor(int a,
2148 + int b ) /*x*/ : /*x*/ BaseClass(a),
2154 + public BaseClass1,
2155 + protected BaseClass2
2157 + int Test() { return FALSE; }
2158 + int Test1() { return TRUE; }
2160 + CAbc(int a, int b ) :
2175 + public: // <-- this was incoreectly indented before!!
2181 + class CAbc : public BaseClass1,
2182 + protected BaseClass2
2190 + } variable[COUNT] =
2206 + } variable[COUNT] =
2212 + void asdf() /* ind_maxparen may cause trouble here */
2304 + 2kdd]]/comment 1/+1
2322 + int Test() { return FALSE; }
2324 + public: // comment
2336 + averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
2343 + /* those are ugly, but consequent */
2345 + func()->asd(asdasdf,
2346 + averylongfunctionname(
2348 + dec)->averylongfunctionname(
2359 + averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
2361 + dec)->asdfasdfasdf(
2373 *** ../vim-6.2.503/src/testdir/test3.ok Sun May 4 13:29:34 2003
2374 --- src/testdir/test3.ok Mon Apr 26 16:57:16 2004
2381 + char *a[] = {"aaa", "bbb",
2385 char *tab[] = {"aaa",
2386 "xx", /* xx */}; /* asdf */
2410 + #if defined(foo) \
2417 + char *foo = "asdf\
2424 + #if defined(foo) \
2426 + char *foo = "asdf\
2432 + char *foo = "asdf\
2447 + Constructor(int a,
2448 + int b ) : BaseClass(a)
2461 + static unsigned sdf,
2463 + unsigned int piet,
2476 + Constructor::Constructor(int a,
2486 + Constructor::Constructor(int a,
2492 + Constructor::Constructor(int a,
2493 + int b ) /*x*/ : /*x*/ BaseClass(a),
2499 + public BaseClass1,
2500 + protected BaseClass2
2502 + int Test() { return FALSE; }
2503 + int Test1() { return TRUE; }
2505 + CAbc(int a, int b ) :
2520 + public: // <-- this was incoreectly indented before!!
2526 + class CAbc : public BaseClass1,
2527 + protected BaseClass2
2535 + } variable[COUNT] =
2551 + } variable[COUNT] =
2557 + void asdf() /* ind_maxparen may cause trouble here */
2646 + int Test() { return FALSE; }
2648 + public: // comment
2656 + averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
2663 + /* those are ugly, but consequent */
2665 + func()->asd(asdasdf,
2666 + averylongfunctionname(
2668 + dec)->averylongfunctionname(
2679 + averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
2681 + dec)->asdfasdfasdf(
2692 *** ../vim-6.2.503/src/version.c Mon Apr 26 12:37:27 2004
2693 --- src/version.c Mon Apr 26 18:54:36 2004
2697 { /* Add new patch number below this line */
2703 `The Guide says there is an art to flying,' said Ford, `or at least a
2704 knack. The knack lies in learning how to throw yourself at the ground
2705 and miss.' He smiled weakly.
2706 -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
2708 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
2709 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
2710 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
2711 \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///