aboutsummaryrefslogtreecommitdiff
path: root/plugins/rainbowparen.lua
diff options
context:
space:
mode:
authorAqil Contractor <aqilcm@gmail.com>2022-07-25 16:26:25 -0400
committerAqil Contractor <aqilcm@gmail.com>2022-07-25 16:26:25 -0400
commitfbd54236151795f7a61a7f87e82f3eef3c3fea16 (patch)
tree7f74ef87bf02be010a9b08a56548f5e389ee26d3 /plugins/rainbowparen.lua
parente63b676925183d3bcf6ee8bf43d6ff901d072ab0 (diff)
downloadlite-xl-plugins-fbd54236151795f7a61a7f87e82f3eef3c3fea16.tar.gz
lite-xl-plugins-fbd54236151795f7a61a7f87e82f3eef3c3fea16.zip
Added an option for number of parens
Diffstat (limited to 'plugins/rainbowparen.lua')
-rw-r--r--plugins/rainbowparen.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/rainbowparen.lua b/plugins/rainbowparen.lua
index 0f4c5c8..6ca4cb4 100644
--- a/plugins/rainbowparen.lua
+++ b/plugins/rainbowparen.lua
@@ -8,7 +8,8 @@ local tokenizer = require "core.tokenizer"
local Highlighter = require "core.doc.highlighter"
config.plugins.rainbowparen = common.merge({
- enabled = true
+ enabled = true,
+ parens = 5
}, config.plugins.rainbowparen)
style.syntax.paren_unbalanced = style.syntax.paren_unbalanced or { common.color "#DC0408" }
@@ -26,7 +27,7 @@ local closers = {
}
local function parenstyle(parenstack)
- return "paren" .. ((#parenstack % 5) + 1)
+ return "paren" .. ((#parenstack % config.plugins.rainbowparen.parens) + 1)
end
function tokenizer.tokenize(syntax, text, state)