diff --git a/data/core/syntax.lua b/data/core/syntax.lua index adecd0cd..8ff5062d 100644 --- a/data/core/syntax.lua +++ b/data/core/syntax.lua @@ -7,6 +7,11 @@ local plain_text_syntax = { name = "Plain Text", patterns = {}, symbols = {} } function syntax.add(t) + -- this rule gives us a performance gain for the tokenizer in lines with + -- long amounts of consecutive spaces without affecting other patterns + if t.patterns then + table.insert(t.patterns, 1, { pattern = "%s+", type = "normal" }) + end table.insert(syntax.items, t) end