diff options
| author | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2024-08-18 16:27:39 -0400 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-01-04 12:14:59 -0700 |
| commit | 57aacac06814dd5d72421b6e5cd969f96a7cd061 (patch) | |
| tree | 1da2a700764137ceaadbf4fad1be6d1779472a9c /lua | |
| parent | e9fb2f04e3a479c965b5d43cdf5608cccb8e498f (diff) | |
| download | vis-57aacac06814dd5d72421b6e5cd969f96a7cd061.tar.gz vis-57aacac06814dd5d72421b6e5cd969f96a7cd061.tar.xz | |
Improve performance of the text lexer
Instead of highlighting non-whitespace characters one at a time,
highlight whole ranges.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lexers/text.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lua/lexers/text.lua b/lua/lexers/text.lua index 1e585ae..a74f8c3 100644 --- a/lua/lexers/text.lua +++ b/lua/lexers/text.lua @@ -7,4 +7,6 @@ local lex = lexer.new('text') lex:add_rule('whitespace', lexer.token(lexer.WHITESPACE, lexer.space^1)) +lex:add_rule('text', lexer.token(lexer.DEFAULT, (1 - lexer.space)^1)) + return lex |
