From 415c6882632e5fec3a32af79cd457d0816d33efd Mon Sep 17 00:00:00 2001 From: Maddison Hellstrom Date: Fri, 12 Apr 2024 22:52:00 -0700 Subject: [PATCH] fix: paragraph width calculation fixes #20 --- lua/nui-components/paragraph.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nui-components/paragraph.lua b/lua/nui-components/paragraph.lua index ce82719..ea7ad2a 100644 --- a/lua/nui-components/paragraph.lua +++ b/lua/nui-components/paragraph.lua @@ -145,12 +145,13 @@ function Paragraph:on_update() local lines = self:get_lines() local size = self:get_size() local props = self:get_props() + local border_delta_size = self:get_border_delta_size() if not self:is_hidden() then self._private.last_width = size.width end - local width = self._private.last_width or size.width + local width = (self._private.last_width or size.width) - border_delta_size.width fn.ieach(lines, function(line, index) local new_line = Line()