mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
vim-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.
d1b15dec4d
This commit is contained in:
@@ -1132,13 +1132,21 @@ static int cin_is_cpp_baseclass(cpp_baseclass_cache_T *cached) {
|
||||
|
||||
pos->lnum = lnum;
|
||||
line = ml_get(lnum);
|
||||
s = cin_skipcomment(line);
|
||||
s = line;
|
||||
for (;; ) {
|
||||
if (*s == NUL) {
|
||||
if (lnum == curwin->w_cursor.lnum)
|
||||
if (lnum == curwin->w_cursor.lnum) {
|
||||
break;
|
||||
/* Continue in the cursor line. */
|
||||
}
|
||||
// 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;
|
||||
|
Reference in New Issue
Block a user