From c1c38701bb4d53304533b67d94e413524fac15e3 Mon Sep 17 00:00:00 2001 From: Jipok Date: Thu, 5 Nov 2020 20:03:18 +0000 Subject: [PATCH] Improve calculating method for width of indent line --- plugins/indentguide.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/indentguide.lua b/plugins/indentguide.lua index daf7d8bb..e125e62f 100644 --- a/plugins/indentguide.lua +++ b/plugins/indentguide.lua @@ -35,11 +35,12 @@ local draw_line_text = DocView.draw_line_text function DocView:draw_line_text(idx, x, y) local spaces = get_line_indent_guide_spaces(self.doc, idx) local sw = self:get_font():get_width(" ") - local w = math.ceil(1 * SCALE) + local w = math.floor(SCALE + 0.5) local h = self:get_line_height() for i = 0, spaces - 1, config.indent_size do local color = style.guide or style.selection - renderer.draw_rect(x + sw * i, y, w, h, color) + -- Offset 1 pixel to avoid gutter overlap + renderer.draw_rect(x + sw * i + 1, y, w, h, color) end draw_line_text(self, idx, x, y) end