summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-11-10 14:06:53 +0100
committerBram Moolenaar <Bram@vim.org>2015-11-10 14:06:53 +0100
commite01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a (patch)
tree4235a8451174d4724c5b5854ae7dcba6635a21ae /src/misc1.c
parent450ca4335e467ac29c1560b7397225a974aee3bf (diff)
downloadvim-e01f4f86cef7bed3cb99b26f9f57d86f6eb5fe1a.zip
patch 7.4.912
Problem: Wrong indenting for C++ constructor. Solution: Recognize ::. (Anhong)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c
index fa1e049d3..5190db4a1 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -6250,6 +6250,19 @@ cin_isfuncdecl(sp, first_lnum, min_lnum)
{
if (cin_iscomment(s)) /* ignore comments */
s = cin_skipcomment(s);
+ else if (*s == ':')
+ {
+ if (*(s + 1) == ':')
+ s += 2;
+ else
+ /* To avoid a mistake in the following situation:
+ * A::A(int a, int b)
+ * : a(0) // <--not a function decl
+ * , b(0)
+ * {...
+ */
+ return FALSE;
+ }
else
++s;
}