diff options
| author | mitchell <unknown> | 2020-07-07 20:14:11 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-07-07 20:14:11 -0400 |
| commit | 329559b74b483576a74d5f87eebf951bd12b9200 (patch) | |
| tree | 4a200348748ccfdd27d1a3f8c0352758b9f9f4c8 /lexlua/diff.lua | |
| parent | 5f930428f724eef7dd0be4706670039b89f3523e (diff) | |
| download | scintilla-mirror-329559b74b483576a74d5f87eebf951bd12b9200.tar.gz | |
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.
Diffstat (limited to 'lexlua/diff.lua')
| -rw-r--r-- | lexlua/diff.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lexlua/diff.lua b/lexlua/diff.lua index 2b3b171f1..c5c6b8738 100644 --- a/lexlua/diff.lua +++ b/lexlua/diff.lua @@ -13,7 +13,7 @@ lex:add_rule('separator', token(lexer.COMMENT, ('---' + P('*')^4 + P('=')^1) * lexer.space^0 * -1)) lex:add_rule('header', token('header', (P('*** ') + '--- ' + '+++ ') * lexer.any^1)) -lex:add_style('header', lexer.STYLE_COMMENT) +lex:add_style('header', lexer.styles.comment) -- Location. lex:add_rule('location', token(lexer.NUMBER, ('@@' + lexer.digit^1 + '****') * @@ -21,11 +21,11 @@ lex:add_rule('location', token(lexer.NUMBER, ('@@' + lexer.digit^1 + '****') * -- Additions, deletions, and changes. lex:add_rule('addition', token('addition', S('>+') * lexer.any^0)) -lex:add_style('addition', 'fore:$(color.green)') +lex:add_style('addition', {fore = lexer.colors.green}) lex:add_rule('deletion', token('deletion', S('<-') * lexer.any^0)) -lex:add_style('deletion', 'fore:$(color.red)') +lex:add_style('deletion', {fore = lexer.colors.red}) lex:add_rule('change', token('change', '!' * lexer.any^0)) -lex:add_style('change', 'fore:$(color.yellow)') +lex:add_style('change', {fore = lexer.colors.yellow}) lex:add_rule('any_line', token(lexer.DEFAULT, lexer.any^1)) |
