Skip to content

Commit

Permalink
fix: remove right padding from paragraph and descendants
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Mar 28, 2024
1 parent ca7d5fc commit 0c1e8ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/nui-components/paragraph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ function Paragraph:prop_types()
end

function Paragraph:_calculate_gap_width(max_width, text_width)
local align = self:get_props().align
local props = self:get_props()
local align = props.align
local truncate = props.truncate

local gap_width = max_width - text_width
if align == "left" then
if align == "left" and not truncate then
return 0, gap_width
elseif align == "center" then
return math.floor(gap_width / 2), math.ceil(gap_width / 2)
Expand Down

0 comments on commit 0c1e8ac

Please sign in to comment.