changeset 2094:e319a4fe6e32 v7.2.378

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)
author Bram Moolenaar <bram@zimbu.org>
date Tue, 02 Mar 2010 12:38:22 +0100
parents 0e4631bf9441
children 8aa3cd045aef
files src/misc1.c src/version.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -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)
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    378,
+/**/
     377,
 /**/
     376,