aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqil Contractor <aqilcm@gmail.com>2022-12-19 05:52:17 -0500
committerGitHub <noreply@github.com>2022-12-19 11:52:17 +0100
commit450d4bb15f6f0b1981c26d811182e1edbc2e03e3 (patch)
treebec579f3dd00243e6483fdd23067e09065122d38
parent7a021d1ad8e6f43de162a4d8e6eccd5159045a6f (diff)
downloadlite-xl-plugins-450d4bb15f6f0b1981c26d811182e1edbc2e03e3.tar.gz
lite-xl-plugins-450d4bb15f6f0b1981c26d811182e1edbc2e03e3.zip
Fix bug with rainbowparen.lua messing with the ability to comment out lines. (#170)
-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)