]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.378 v7.2.378
authorBram Moolenaar <Bram@vim.org>
Tue, 2 Mar 2010 11:38:22 +0000 (12:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 2 Mar 2010 11:38:22 +0000 (12:38 +0100)
Problem:    C function declaration indented too much. (Rui)
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)

src/misc1.c
src/version.c

index 6b6f33991236a7ffcb906b83dc5f1f3a459648bb..f67f9c6a59f221c05bcc9ec3eb819c91a33cf3f6 100644 (file)
@@ -7727,11 +7727,14 @@ term_again:
        /*
         * If the NEXT line is a function declaration, the current
         * line needs to be indented as a function type spec.
-        * Don't do this if the current line looks like a comment
-        * or if the current line is terminated, ie. ends in ';'.
+        * Don't do this if the current line looks like a comment or if the
+        * 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
                && !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_isfuncdecl(NULL, cur_curpos.lnum + 1)
index 90096ac18cc625badb16fa9a4004eb96927e2cc5..4837d202bc186b7fa35741148f2f4d516e9ea3d6 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    378,
 /**/
     377,
 /**/