diff --git a/C++/C.sublime-syntax b/C++/C.sublime-syntax index 0f5385f48be..40aed805783 100644 --- a/C++/C.sublime-syntax +++ b/C++/C.sublime-syntax @@ -451,7 +451,7 @@ contexts: data-structures: # Detect variable type definitions using struct/enum/union followed by a tag - - match: '\b({{before_tag}})(?=\s+{{identifier}}\s+{{identifier}}\s*[=;\[])' + - match: '\b({{before_tag}})(?=\s+{{identifier}}\s+\**\s*{{identifier}}\s*[=;\[])' scope: storage.type.c - match: '\bstruct\b' scope: storage.type.c diff --git a/C++/syntax_test_c.c b/C++/syntax_test_c.c index 838d21b7cb3..cde35d5196b 100644 --- a/C++/syntax_test_c.c +++ b/C++/syntax_test_c.c @@ -313,6 +313,10 @@ struct foo MACRO { /* ^ - entity.name */ } +struct UI_BoundingBox *position_p; +/* ^ - entity.name */ +/* ^ - entity.name */ + // Partially-typed struct foo /* ^ entity.name */ @@ -324,6 +328,12 @@ struct UI_MenuBoxData struct UI_BoundingBox position; /* ^ - entity.name */ /* ^ - entity.name */ + struct UI_BoundingBox *position_p; +/* ^ - entity.name */ +/* ^ - entity.name */ + struct UI_BoundingBox * position_p2; +/* ^ - entity.name */ +/* ^ - entity.name */ enum UI_BoxCharType borderType; /* ^ - entity.name */ /* ^ - entity.name */