diff options
Diffstat (limited to 'plugins')
-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) |