From 2038dadc042a9f5e8c4e6ab3018a022555069092 Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Sat, 21 Oct 2023 00:39:44 +1100 Subject: [PATCH] [C/C++/ObjC/ObjC++] Fix javadoc comment word wrap (#3855) This commit restores scoping leading asterisks in block comments `punctuation.definition.comment` to maintain proper word wrapping. related with e4e5273d8ca764ebcd79b2ecfbed592036944265 Co-authored-by: Benjamin Schaaf --- C++/C.sublime-syntax | 3 +++ C++/syntax_test_c.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C++/C.sublime-syntax b/C++/C.sublime-syntax index acc62185b1..8c313daa48 100644 --- a/C++/C.sublime-syntax +++ b/C++/C.sublime-syntax @@ -106,6 +106,9 @@ contexts: - match: \*/ scope: punctuation.definition.comment.end.c pop: true + - match: ^\s*(\*)(?!\**/) + captures: + 1: punctuation.definition.comment.c line-comments: - match: ^(//) =\s*(.*?)\s*=\s*$\n? diff --git a/C++/syntax_test_c.c b/C++/syntax_test_c.c index 97745de0ce..44874b80cd 100644 --- a/C++/syntax_test_c.c +++ b/C++/syntax_test_c.c @@ -427,7 +427,7 @@ struct X /* * -/* ^ comment.block.c - punctuation */ +/* ^ comment.block.c punctuation.definition.comment.c */ ///////////////////////////////////////////// // Preprocessor branches starting blocks