Skip to content

Commit

Permalink
Improved performance of the text lexer.
Browse files Browse the repository at this point in the history
Instead of highlighting non-whitespace characters one at a time, highlight whole ranges.
  • Loading branch information
orbitalquark committed Aug 18, 2024
1 parent 0c92946 commit c929e9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lexers/text.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c929e9d

Please sign in to comment.