From 63f406773b21e7f214daabcaa5c03f3a2320361f Mon Sep 17 00:00:00 2001 From: cukmekerb Date: Thu, 22 Jul 2021 22:02:49 -0700 Subject: [PATCH] align line numbers to right --- data/core/docview.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/core/docview.lua b/data/core/docview.lua index ceed8636..139333cc 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -391,7 +391,8 @@ function DocView:draw_line_gutter(idx, x, y) end local yoffset = self:get_line_text_y_offset() x = x + style.padding.x - renderer.draw_text(self:get_font(), idx, x, y + yoffset, color) + local width = string.len(tostring(#self.doc.lines)) * style.padding.x / 2 + style.padding.x / 2 + common.draw_text(self:get_font(), color, idx, "right", x, y + yoffset, width, self:get_line_height()) end