aboutsummaryrefslogtreecommitdiff
path: root/plugins/bracketmatch.lua
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-05-22 14:37:28 -0400
committerjgmdev <jgmdev@gmail.com>2022-05-22 14:37:28 -0400
commit76bacb1fe9d0d92bb8c22a6767a98b0589d4bdd3 (patch)
tree11091b18f989d310fe43996b60e15ff482520c50 /plugins/bracketmatch.lua
parent694132ec9d81ced3d8c6ebbf10e451bbc5a9e65b (diff)
downloadlite-xl-plugins-76bacb1fe9d0d92bb8c22a6767a98b0589d4bdd3.tar.gz
lite-xl-plugins-76bacb1fe9d0d92bb8c22a6767a98b0589d4bdd3.zip
Fix various plugins for linewrapping
Diffstat (limited to 'plugins/bracketmatch.lua')
-rw-r--r--plugins/bracketmatch.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/bracketmatch.lua b/plugins/bracketmatch.lua
index e86e64c..5930b7b 100644
--- a/plugins/bracketmatch.lua
+++ b/plugins/bracketmatch.lua
@@ -96,16 +96,18 @@ end
local draw_line_text = DocView.draw_line_text
-function DocView:draw_line_text(idx, x, y)
- draw_line_text(self, idx, x, y)
+function DocView:draw_line_text(line, x, y)
+ local lh = draw_line_text(self, line, x, y)
- if self.doc == state.doc and idx == state.line2 then
+ if self.doc == state.doc and line == state.line2 then
local color = style.bracketmatch_color or style.syntax["function"]
- local x1 = x + self:get_col_x_offset(idx, state.col2)
- local x2 = x + self:get_col_x_offset(idx, state.col2 + 1)
+ local x1 = x + self:get_col_x_offset(line, state.col2)
+ local x2 = x + self:get_col_x_offset(line, state.col2 + 1)
local h = math.ceil(1 * SCALE)
renderer.draw_rect(x1, y + self:get_line_height() - h, x2 - x1, h, color)
end
+
+ return lh
end