summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-03-02 12:38:22 +0100
committerBram Moolenaar <Bram@vim.org>2010-03-02 12:38:22 +0100
commit1a89bbe8497a4bef4b97219f6ca1264f3c09e5ba (patch)
treef4e18b65f8e471c9c1ba45526153bcacf2b7c706 /src/misc1.c
parent86ce1cc086449a39c48e1672b0f6053f07301429 (diff)
downloadvim-git-1a89bbe8497a4bef4b97219f6ca1264f3c09e5ba.tar.gz
updated for version 7.2.378v7.2.378
Problem: C function declaration indented too much. (Rui) Solution: Don't see a line containing { or } as a type. (Matt Wozniski)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 6b6f33991..f67f9c6a5 100644
--- 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)