Mercurial > vim
diff src/misc1.c @ 7164:d3c57e7f489a v7.4.893
commit https://github.com/vim/vim/commit/d1b15dec4d00d7ed5e92ff4e0fb7fc2e0818e479
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 13 16:13:39 2015 +0200
patch 7.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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Oct 2015 16:15:05 +0200 |
parents | accd3a0e9bf4 |
children | 41885de3d577 |
line wrap: on
line diff
--- 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;