aboutsummaryrefslogtreecommitdiff
path: root/plugins/rainbowparen.lua
diff options
context:
space:
mode:
authorStunxFS <56417208+StunxFS@users.noreply.github.com>2022-12-31 20:33:25 -0400
committerGitHub <noreply@github.com>2022-12-31 20:33:25 -0400
commit975243113fa52cc1f9549526f0a48d8b98179b37 (patch)
treee5ca4bcfa0e37bdb0838ffc1ee44c5c2d4e01c0c /plugins/rainbowparen.lua
parentfadbb0aae2dcbc5a418647f7ba7397b6380854f3 (diff)
parentbf3a3b7b75efc54869df6f62363b5b94191a85cc (diff)
downloadlite-xl-plugins-975243113fa52cc1f9549526f0a48d8b98179b37.tar.gz
lite-xl-plugins-975243113fa52cc1f9549526f0a48d8b98179b37.zip
Merge branch 'lite-xl:master' into master
Diffstat (limited to 'plugins/rainbowparen.lua')
-rw-r--r--plugins/rainbowparen.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/rainbowparen.lua b/plugins/rainbowparen.lua
index 6ca4cb4..075667e 100644
--- a/plugins/rainbowparen.lua
+++ b/plugins/rainbowparen.lua
@@ -20,6 +20,7 @@ style.syntax.paren4 = style.syntax.paren4 or { common.color "#52dab2"}
style.syntax.paren5 = style.syntax.paren5 or { common.color "#5a98cf"}
local tokenize = tokenizer.tokenize
+local extract_subsyntaxes = tokenizer.extract_subsyntaxes
local closers = {
["("] = ")",
["["] = "]",
@@ -30,6 +31,13 @@ local function parenstyle(parenstack)
return "paren" .. ((#parenstack % config.plugins.rainbowparen.parens) + 1)
end
+function tokenizer.extract_subsyntaxes(base_syntax, state)
+ if not config.plugins.rainbowparen.enabled then
+ return extract_subsyntaxes(base_syntax, state)
+ end
+ return extract_subsyntaxes(base_syntax, state.istate)
+end
+
function tokenizer.tokenize(syntax, text, state)
if not config.plugins.rainbowparen.enabled then
return tokenize(syntax, text, state)