summaryrefslogtreecommitdiffstats
path: root/src/cindent.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-12-22 20:55:30 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-22 20:55:30 +0000
commitf2f0bddf303e37d4d532ca22e2d53179c20b1d19 (patch)
tree628c3660c385a270fa06d7129e504e8155426b03 /src/cindent.c
parentb4168fd917e869912e0649fe13c10e5e6a595199 (diff)
patch 8.2.3876: 'cindent' does not recognize inline namespacev8.2.3876
Problem: 'cindent' does not recognize inline namespace. Solution: Skip over "inline" to find "namespace". (closes #9383)
Diffstat (limited to 'src/cindent.c')
-rw-r--r--src/cindent.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cindent.c b/src/cindent.c
index 4fa165e699..42b46e4016 100644
--- a/src/cindent.c
+++ b/src/cindent.c
@@ -755,6 +755,10 @@ cin_is_cpp_namespace(char_u *s)
int has_name_start = FALSE;
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])))
{
p = cin_skipcomment(skipwhite(s + 9));