From 6fc556eb41814ab8e07be6f39ba4f86a5b6d56be Mon Sep 17 00:00:00 2001 From: Kyle McLamb Date: Sun, 7 Feb 2016 00:52:21 -0500 Subject: [PATCH] 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. --- ldoc/lexer.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ldoc/lexer.lua b/ldoc/lexer.lua index a396652..c04a504 100644 --- a/ldoc/lexer.lua +++ b/ldoc/lexer.lua @@ -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},