From aab4443bb907a0cf7ef874c22f8cfae667b65552 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 25 Mar 2023 09:27:42 +0800 Subject: 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> --- src/nvim/indent_c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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)); } -- cgit