summaryrefslogtreecommitdiffstats
path: root/src/cindent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cindent.c')
-rw-r--r--src/cindent.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/cindent.c b/src/cindent.c
index ca21c123e0..a22db9560e 100644
--- a/src/cindent.c
+++ b/src/cindent.c
@@ -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);
+
+ 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;
+ }
+ }
- 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] != ':');
+ vim_free(cinsd_buf);
+ }
+
+ return FALSE;
}
/*