diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-03-25 09:27:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-25 09:27:42 +0800 |
commit | aab4443bb907a0cf7ef874c22f8cfae667b65552 (patch) | |
tree | 7fb8c3ceba55c2f1317ec7cb4e9fff76e377f21a /src | |
parent | ac7397f4a06e451fedde86fb4eba0038d0d75e68 (diff) | |
download | rneovim-aab4443bb907a0cf7ef874c22f8cfae667b65552.tar.gz rneovim-aab4443bb907a0cf7ef874c22f8cfae667b65552.tar.bz2 rneovim-aab4443bb907a0cf7ef874c22f8cfae667b65552.zip |
vim-patch:9.0.1426: indent wrong after "export namespace" in C++ (#22777)
Problem: Indent wrong after "export namespace" in C++.
Solution: Skip over "inline" and "export" in any order. (Virginia Senioria,
closes vim/vim#12134, closes vim/vim#12133)
https://github.com/vim/vim/commit/99e4ab2a1e577ddb29030c09c308b67e16fd51c4
Co-authored-by: Virginia Senioria <91khr@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/indent_c.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 3e7f640326..f7bf9c46a4 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -525,7 +525,9 @@ static bool cin_is_cpp_namespace(const char *s) s = cin_skipcomment(s); - if (strncmp(s, "inline", 6) == 0 && (s[6] == NUL || !vim_iswordc((uint8_t)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((uint8_t)s[6]))) { s = cin_skipcomment(skipwhite(s + 6)); } |