Skip to content

Commit 67cb2f7

Browse files
authored
Merge pull request #21 from b0o/fix-paragraph-overflow
fix: paragraph width calculation
2 parents 0af84e5 + 415c688 commit 67cb2f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/nui-components/paragraph.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@ function Paragraph:on_update()
145145
local lines = self:get_lines()
146146
local size = self:get_size()
147147
local props = self:get_props()
148+
local border_delta_size = self:get_border_delta_size()
148149

149150
if not self:is_hidden() then
150151
self._private.last_width = size.width
151152
end
152153

153-
local width = self._private.last_width or size.width
154+
local width = (self._private.last_width or size.width) - border_delta_size.width
154155

155156
fn.ieach(lines, function(line, index)
156157
local new_line = Line()

0 commit comments

Comments
 (0)