0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.4702: C++ scope labels are hard-coded

Problem:    C++ scope labels are hard-coded.
Solution:   Add 'cinscopedecls' to define the labels. (Rom Praschan,
            closes #10109)
This commit is contained in:
Tom Praschan
2022-04-07 12:39:08 +01:00
committed by Bram Moolenaar
parent 3ad2090316
commit 3506cf34c1
13 changed files with 112 additions and 17 deletions

View File

@@ -423,20 +423,34 @@ cin_islabel_skip(char_u **s)
* Recognize a "public/private/protected" scope declaration label.
*/
static int
cin_isscopedecl(char_u *s)
cin_isscopedecl(char_u *p)
{
int i;
size_t cinsd_len;
char_u *cinsd_buf;
char_u *cinsd;
size_t len;
char_u *skip;
char_u *s = cin_skipcomment(p);
s = cin_skipcomment(s);
if (STRNCMP(s, "public", 6) == 0)
i = 6;
else if (STRNCMP(s, "protected", 9) == 0)
i = 9;
else if (STRNCMP(s, "private", 7) == 0)
i = 7;
else
return FALSE;
return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':');
cinsd_len = STRLEN(curbuf->b_p_cinsd) + 1;
cinsd_buf = alloc(cinsd_len);
if (cinsd_buf != NULL)
{
for (cinsd = curbuf->b_p_cinsd; *cinsd; )
{
len = copy_option_part(&cinsd, cinsd_buf, cinsd_len, ",");
if (STRNCMP(s, cinsd_buf, len) == 0)
{
skip = cin_skipcomment(s + len);
if (*skip == ':' && skip[1] != ':')
return TRUE;
}
}
vim_free(cinsd_buf);
}
return FALSE;
}
/*