Fix end-of-block comments not highlighting

Originally, comments in code blocks were highlighted by looking for
their starting token at the beginning and a newline at the end.

This PR adds two new comment patterns that look for the end-of-string
instead of a newline, so that comments on the last line of a block are
still highlighted.
This commit is contained in:
Kyle McLamb 2016-02-07 00:52:21 -05:00
parent aa4cd9daf8
commit 6fc556eb41
1 changed files with 2 additions and 0 deletions

View File

@ -305,6 +305,7 @@ function lexer.lua(s,filter,options)
{'^`[^`]+`',bdump},
{'^%-%-%[(=*)%[.-%]%1%]',cdump},
{'^%-%-.-\n',cdump},
{'^%-%-.-$',cdump},
{'^%[(=*)%[.-%]%1%]',sdump_l},
{'^==',tdump},
{'^~=',tdump},
@ -354,6 +355,7 @@ function lexer.cpp(s,filter,options,no_string)
{STRING1,chdump},
{STRING2,sdump},
{'^//.-\n',cdump},
{'^//.-$',cdump},
{'^/%*.-%*/',cdump},
{'^==',tdump},
{'^!=',tdump},