From 4ad353eb4b106ceea46b1d179b23ec481798c6b6 Mon Sep 17 00:00:00 2001 From: cukmekerb Date: Thu, 22 Jul 2021 22:20:04 -0700 Subject: [PATCH] fix line number align bug --- data/core/docview.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/docview.lua b/data/core/docview.lua index 139333cc..3ecb699f 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -391,7 +391,7 @@ function DocView:draw_line_gutter(idx, x, y) end local yoffset = self:get_line_text_y_offset() x = x + style.padding.x - local width = string.len(tostring(#self.doc.lines)) * style.padding.x / 2 + style.padding.x / 2 + local width = local width = self:get_font():get_width(#self.doc.lines) common.draw_text(self:get_font(), color, idx, "right", x, y + yoffset, width, self:get_line_height()) end