diff options
| author | zsugabubus <zsugabubus@users.noreply.github.com> | 2020-01-12 12:18:01 +0100 |
|---|---|---|
| committer | zsugabubus <zsugabubus@users.noreply.github.com> | 2020-01-12 12:23:31 +0100 |
| commit | 807ba6f6850bf7dbf86fd65299248f2d9cba7f75 (patch) | |
| tree | 0973618823ea3fe9e0d0ebcd4aa001ec67f4bbbc /lua | |
| parent | e136e348cbd0ea4bf2dd8de6f98da1ca1924bc96 (diff) | |
| download | vis-807ba6f6850bf7dbf86fd65299248f2d9cba7f75.tar.gz vis-807ba6f6850bf7dbf86fd65299248f2d9cba7f75.tar.xz | |
lexers: match whitespaces in text lexer
Otherwise, show-{tabs,newlines,spaces} replacement characters are
undistinguishable from normal text.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lexers/text.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/lexers/text.lua b/lua/lexers/text.lua index 4988d95..cc41bfa 100644 --- a/lua/lexers/text.lua +++ b/lua/lexers/text.lua @@ -1,6 +1,15 @@ -- Copyright 2006-2017 Mitchell mitchell.att.foicica.com. See LICENSE. -- Text LPeg lexer. +local l = require('lexer') + local M = {_NAME = 'text'} +-- Whitespace. +local ws = l.token(l.WHITESPACE, l.space^1) + +M._rules = { + {'whitespace', ws}, +} + return M |
