mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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)
99e4ab2a1e
Co-authored-by: Virginia Senioria <91khr@users.noreply.github.com>
This commit is contained in:
parent
ac7397f4a0
commit
aab4443bb9
@ -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));
|
||||
}
|
||||
|
||||
|
@ -4392,6 +4392,18 @@ func Test_cindent_47()
|
||||
inline/* test */namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export inline namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export/* test */inline namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
inline export namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
|
||||
/* invalid namespaces use block indent */
|
||||
namespace test test2 {
|
||||
@ -4495,6 +4507,18 @@ func Test_cindent_47()
|
||||
inline/* test */namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export inline namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
export/* test */inline namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
inline export namespace {
|
||||
111111111111111111;
|
||||
}
|
||||
|
||||
/* invalid namespaces use block indent */
|
||||
namespace test test2 {
|
||||
|
Loading…
Reference in New Issue
Block a user