1
0
forked from aniani/vim

updated for version 7.2.378

Problem:    C function declaration indented too much. (Rui)
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)
This commit is contained in:
Bram Moolenaar
2010-03-02 12:38:22 +01:00
parent 86ce1cc086
commit 1a89bbe849
2 changed files with 7 additions and 2 deletions

View File

@@ -7727,11 +7727,14 @@ term_again:
/* /*
* If the NEXT line is a function declaration, the current * If the NEXT line is a function declaration, the current
* line needs to be indented as a function type spec. * line needs to be indented as a function type spec.
* Don't do this if the current line looks like a comment * Don't do this if the current line looks like a comment or if the
* or if the current line is terminated, ie. ends in ';'. * current line is terminated, ie. ends in ';', or if the current line
* contains { or }: "void f() {\n if (1)"
*/ */
else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
&& !cin_nocode(theline) && !cin_nocode(theline)
&& vim_strchr(theline, '{') == NULL
&& vim_strchr(theline, '}') == NULL
&& !cin_ends_in(theline, (char_u *)":", NULL) && !cin_ends_in(theline, (char_u *)":", NULL)
&& !cin_ends_in(theline, (char_u *)",", NULL) && !cin_ends_in(theline, (char_u *)",", NULL)
&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1) && cin_isfuncdecl(NULL, cur_curpos.lnum + 1)

View File

@@ -681,6 +681,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
378,
/**/ /**/
377, 377,
/**/ /**/