Skip to content

Commit

Permalink
Merge pull request #21 from b0o/fix-paragraph-overflow
Browse files Browse the repository at this point in the history
fix: paragraph width calculation
  • Loading branch information
mobily authored Apr 14, 2024
2 parents 0af84e5 + 415c688 commit 67cb2f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/nui-components/paragraph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 67cb2f7

Please sign in to comment.