From 76bacb1fe9d0d92bb8c22a6767a98b0589d4bdd3 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Sun, 22 May 2022 14:37:28 -0400 Subject: Fix various plugins for linewrapping --- plugins/bracketmatch.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/bracketmatch.lua') 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 -- cgit v1.2.3