diff options
author | Virginia Senioria <91khr@users.noreply.github.com> | 2023-03-24 19:25:06 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-03-24 19:25:06 +0000 |
commit | 99e4ab2a1e577ddb29030c09c308b67e16fd51c4 (patch) | |
tree | 75fa4b40fe1e787efa79eb1b94dbba2a958fe4b2 /src/cindent.c | |
parent | 3ea62381c527395ae701715335776f427d22eb7b (diff) |
patch 9.0.1426: indent wrong after "export namespace" in C++v9.0.1426
Problem: Indent wrong after "export namespace" in C++.
Solution: Skip over "inline" and "export" in any order. (Virginia Senioria,
closes #12134, closes #12133)
Diffstat (limited to 'src/cindent.c')
-rw-r--r-- | src/cindent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cindent.c b/src/cindent.c index e8e255feb3..176bc05282 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -769,7 +769,9 @@ cin_is_cpp_namespace(char_u *s) s = cin_skipcomment(s); - if (STRNCMP(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc(s[6]))) + // skip over "inline" and "export" in any order + while ((STRNCMP(s, "inline", 6) == 0 || STRNCMP(s, "export", 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]))) |