From 02a59293a9b2d2f4e986d0543e6a21b65a35451a Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sat, 28 Oct 2023 13:00:35 +0200 Subject: `rainbowparen`: Handle `resume` parameter in `tokenizer.tokenize` (#325) This stopped the tokenization from continuing, which resulted in lines not being completely tokenized. --- plugins/rainbowparen.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/rainbowparen.lua b/plugins/rainbowparen.lua index 075667e..481ce55 100644 --- a/plugins/rainbowparen.lua +++ b/plugins/rainbowparen.lua @@ -38,12 +38,12 @@ function tokenizer.extract_subsyntaxes(base_syntax, state) return extract_subsyntaxes(base_syntax, state.istate) end -function tokenizer.tokenize(syntax, text, state) +function tokenizer.tokenize(syntax, text, state, resume) if not config.plugins.rainbowparen.enabled then - return tokenize(syntax, text, state) + return tokenize(syntax, text, state, resume) end state = state or {} - local res, istate = tokenize(syntax, text, state.istate) + local res, istate, resume = tokenize(syntax, text, state.istate, resume) local parenstack = state.parenstack or "" local newres = {} -- split parens out @@ -77,7 +77,7 @@ function tokenizer.tokenize(syntax, text, state) table.insert(newres, text) end end - return newres, { parenstack = parenstack, istate = istate } + return newres, { parenstack = parenstack, istate = istate }, resume end local function toggle_rainbowparen(enabled) -- cgit v1.2.3