vim-patch:8.2.3876: 'cindent' does not recognize inline namespace

Problem:    'cindent' does not recognize inline namespace.
Solution:   Skip over "inline" to find "namespace". (closes vim/vim#9383)
f2f0bddf30
This commit is contained in:
zeertzjq
2021-12-23 07:41:23 +08:00
parent de8a2f20e9
commit 67bf5c237f
2 changed files with 53 additions and 0 deletions

View File

@@ -541,6 +541,11 @@ static bool cin_is_cpp_namespace(char_u *s)
bool has_name_start = false;
s = cin_skipcomment(s);
if (STRNCMP(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc(s[6]))) {
s = cin_skipcomment(skipwhite(s + 6));
}
if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9]))) {
p = cin_skipcomment(skipwhite(s + 9));
while (*p != NUL) {