Open Cooldude2606 opened 4 years ago
Is the --[[--
something specific to the doc generator you're using? I thought Lua multiline comments were --[[ blah ]]--
Yes --[[--
and ]]
is for the doc generator which I am using. This is still compatible with lua multiline comments which are --[[
and ]]
. The extra --
is to tell the doc generator to parse this comment as a doc comment, rather than ignore it.
The issue if that any non white space character after the --[[
will stop your highlighting.
In my example above --[[A test
would also stop the highlighting from working.
After looking at your regex matching for multiline blocks I found that the reason it is not detected is because you are making white space required as part of the comment block start.
For lua the regex that would be created is (^|[ \t])(--\[\[[\s])+([\s\S]*?)(\]\])
Is there a reason why you have the white space match after the block start delimiter?
Also on a side note; is there a reason that the \s is inside a character set when it is the only character inside the set?
I am using a Lua documentation generator and was hoping this extension would allow me to add highlighting to my doc comments. In order to start a doc comment I must use
--[[--
and to end use]]
, which is compatible with lua multiline comments.The issue is that when the extra
--
are added after the--[[
the highlighter no longer detects the multiline comment. This is also caused when you have any non white space character after the comment start.TL;DR - Non white space after comment start will stop the comment being detected.
Example Doc Comment: Example With
--
Removed: custom tags were used to highlight the lines