Skip to content

Commit df76b02

Browse files
authored
[Lua] Fix block comments after doc comments (#4141)
1 parent 3fb12d9 commit df76b02

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Lua/Lua.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ contexts:
152152
set: maybe-line-doc-comment
153153

154154
maybe-line-doc-comment:
155-
- match: ^\s*(?=--(?!\[\[))
155+
- match: ^\s*(?=--(?!\[(=*)\[))
156156
set:
157157
- match: -{2,}
158158
scope: punctuation.definition.comment.lua

Lua/tests/syntax_test_lua.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@
8787
-- no more doc comment after empty line
8888
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - comment.line.documentation
8989

90+
--- Another doc comment
91+
--[=[ block comments after should work with an equals
92+
-- ^^^^^ comment.block punctuation.definition.comment.begin
93+
commented
94+
-- ^^^^^^^^^ comment.block
95+
]=]
96+
-- ^^^ comment.block punctuation.definition.comment.end
97+
9098
-----------------
9199
--^^^^^^^^^^^^^^^ comment.line.documentation.lua punctuation.definition.comment.lua
92100
-- This will also do.

0 commit comments

Comments
 (0)