From 329559b74b483576a74d5f87eebf951bd12b9200 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 7 Jul 2020 20:14:11 -0400 Subject: lexlua: Added `lexer.colors` and `lexer.styles` tables for themes and lexers. This allows for a more Lua table-oriented approach to defining and using colors and styles, instead of manually manipulating Scintilla property strings. Themes and lexers are still backwards compatible, as the underlying mechanisms are still in place. --- lexlua/html.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexlua/html.lua') diff --git a/lexlua/html.lua b/lexlua/html.lua index 465a828b6..5ce566750 100644 --- a/lexlua/html.lua +++ b/lexlua/html.lua @@ -41,7 +41,7 @@ local element = known_element + unknown_element lex:add_rule('element', element) lex:add_style('single_element', lexer.STYLE_KEYWORD) lex:add_style('element', lexer.STYLE_KEYWORD) -lex:add_style('unknown_element', lexer.STYLE_KEYWORD .. ',italics') +lex:add_style('unknown_element', lexer.STYLE_KEYWORD .. {italics = true}) -- Closing tags. local tag_close = token('element', P('/')^-1 * '>') @@ -65,7 +65,7 @@ local unknown_attribute = token('unknown_attribute', (lexer.alnum + '-')^1) local attribute = (known_attribute + unknown_attribute) * #(lexer.space^0 * '=') lex:add_rule('attribute', attribute) lex:add_style('attribute', lexer.STYLE_TYPE) -lex:add_style('unknown_attribute', lexer.STYLE_TYPE .. ',italics') +lex:add_style('unknown_attribute', lexer.STYLE_TYPE .. {italics = true}) -- TODO: performance is terrible on large files. local in_tag = P(function(input, index) -- cgit v1.2.3