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 | |
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.
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | plugins/rainbowparen.lua | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/manifest.json b/manifest.json index 2ce4030..e80bd38 100644 --- a/manifest.json +++ b/manifest.json @@ -1450,7 +1450,7 @@ }, { "description": "Show nesting of parentheses with rainbow colours", - "version": "0.1", + "version": "0.1.1", "path": "plugins/rainbowparen.lua", "id": "rainbowparen", "mod_version": "3" 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) |