vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit a7234a3e5e6f18ed5e4fa455e9a6a0905d818a49
parent 6dff861cc1d5f3b06d0bb3b1025367b7915f2c6e
Author: zsugabubus <zsugabubus@users.noreply.github.com>
Date:   Sun, 12 Jan 2020 12:18:01 +0100

lexers: match whitespaces in text lexer

Otherwise, show-{tabs,newlines,spaces} replacement characters are
undistinguishable from normal text.

Diffstat:
Mlua/lexers/text.lua | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git 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