diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2023-10-28 13:00:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-28 13:00:35 +0200 |
commit | 02a59293a9b2d2f4e986d0543e6a21b65a35451a (patch) | |
tree | bcea0b01272b49dbff3cb1f3a45444ea03b81dcd /plugins/rainbowparen.lua | |
parent | 9fec01149ec391194f9eaa0d5e3926f14a9e0b80 (diff) | |
download | lite-xl-plugins-02a59293a9b2d2f4e986d0543e6a21b65a35451a.tar.gz lite-xl-plugins-02a59293a9b2d2f4e986d0543e6a21b65a35451a.zip |
`rainbowparen`: Handle `resume` parameter in `tokenizer.tokenize` (#325)
This stopped the tokenization from continuing, which resulted in lines
not being completely tokenized.
Diffstat (limited to 'plugins/rainbowparen.lua')
-rw-r--r-- | plugins/rainbowparen.lua | 8 |
1 files changed, 4 insertions, 4 deletions
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) |