diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-10-13 16:13:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-10-13 16:13:39 +0200 |
commit | d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479 (patch) | |
tree | fc48b9da7efe42238ba08d191af9dd0e31f45a34 /src/misc1.c | |
parent | 9d6ca1cc5ebb6e61cc2ef73aecfbb0bdbb65432f (diff) | |
download | vim-git-7.4.893.tar.gz |
patch 7.4.893v7.4.893
Problem: C indenting is wrong below a "case (foo):" because it is
recognized as a C++ base class construct. Issue #38.
Solution: Check for the case keyword.
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/misc1.c b/src/misc1.c index 60e814694..aacf610ad 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -6555,7 +6555,7 @@ cin_is_cpp_baseclass(cached) pos->lnum = lnum; line = ml_get(lnum); - s = cin_skipcomment(line); + s = line; for (;;) { if (*s == NUL) @@ -6564,6 +6564,13 @@ cin_is_cpp_baseclass(cached) break; /* Continue in the cursor line. */ line = ml_get(++lnum); + s = line; + } + if (s == line) + { + /* don't recognize "case (foo):" as a baseclass */ + if (cin_iscase(s, FALSE)) + break; s = cin_skipcomment(line); if (*s == NUL) continue; |