mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
de8a2f20e9
commit
67bf5c237f
@ -541,6 +541,11 @@ static bool cin_is_cpp_namespace(char_u *s)
|
|||||||
bool has_name_start = false;
|
bool has_name_start = false;
|
||||||
|
|
||||||
s = cin_skipcomment(s);
|
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]))) {
|
if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9]))) {
|
||||||
p = cin_skipcomment(skipwhite(s + 9));
|
p = cin_skipcomment(skipwhite(s + 9));
|
||||||
while (*p != NUL) {
|
while (*p != NUL) {
|
||||||
|
@ -997,6 +997,15 @@ func Test_cindent_1()
|
|||||||
22222222222222222;
|
22222222222222222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inline namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline /* test */ namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline/* test */namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
/* invalid namespaces use block indent */
|
/* invalid namespaces use block indent */
|
||||||
namespace test test2 {
|
namespace test test2 {
|
||||||
@ -1020,6 +1029,9 @@ func Test_cindent_1()
|
|||||||
{
|
{
|
||||||
111111111111111111;
|
111111111111111111;
|
||||||
}
|
}
|
||||||
|
inlinenamespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
void getstring() {
|
void getstring() {
|
||||||
/* Raw strings */
|
/* Raw strings */
|
||||||
@ -1962,6 +1974,15 @@ func Test_cindent_1()
|
|||||||
22222222222222222;
|
22222222222222222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inline namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline /* test */ namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline/* test */namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
/* invalid namespaces use block indent */
|
/* invalid namespaces use block indent */
|
||||||
namespace test test2 {
|
namespace test test2 {
|
||||||
@ -1985,6 +2006,9 @@ func Test_cindent_1()
|
|||||||
{
|
{
|
||||||
111111111111111111;
|
111111111111111111;
|
||||||
}
|
}
|
||||||
|
inlinenamespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
void getstring() {
|
void getstring() {
|
||||||
/* Raw strings */
|
/* Raw strings */
|
||||||
@ -4359,6 +4383,15 @@ func Test_cindent_47()
|
|||||||
22222222222222222;
|
22222222222222222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inline namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline /* test */ namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline/* test */namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
/* invalid namespaces use block indent */
|
/* invalid namespaces use block indent */
|
||||||
namespace test test2 {
|
namespace test test2 {
|
||||||
@ -4382,6 +4415,9 @@ func Test_cindent_47()
|
|||||||
{
|
{
|
||||||
111111111111111111;
|
111111111111111111;
|
||||||
}
|
}
|
||||||
|
inlinenamespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
NAMESPACEEND
|
NAMESPACEEND
|
||||||
[CODE]
|
[CODE]
|
||||||
|
|
||||||
@ -4450,6 +4486,15 @@ func Test_cindent_47()
|
|||||||
22222222222222222;
|
22222222222222222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
inline namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline /* test */ namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
inline/* test */namespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
|
|
||||||
/* invalid namespaces use block indent */
|
/* invalid namespaces use block indent */
|
||||||
namespace test test2 {
|
namespace test test2 {
|
||||||
@ -4473,6 +4518,9 @@ func Test_cindent_47()
|
|||||||
{
|
{
|
||||||
111111111111111111;
|
111111111111111111;
|
||||||
}
|
}
|
||||||
|
inlinenamespace {
|
||||||
|
111111111111111111;
|
||||||
|
}
|
||||||
NAMESPACEEND
|
NAMESPACEEND
|
||||||
|
|
||||||
[CODE]
|
[CODE]
|
||||||
|
Loading…
Reference in New Issue
Block a user