diff options
author | StunxFS <56417208+StunxFS@users.noreply.github.com> | 2022-12-31 20:33:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 20:33:25 -0400 |
commit | 975243113fa52cc1f9549526f0a48d8b98179b37 (patch) | |
tree | e5ca4bcfa0e37bdb0838ffc1ee44c5c2d4e01c0c /plugins/rainbowparen.lua | |
parent | fadbb0aae2dcbc5a418647f7ba7397b6380854f3 (diff) | |
parent | bf3a3b7b75efc54869df6f62363b5b94191a85cc (diff) | |
download | lite-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.lua | 8 |
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) |