Skip to content

Commit 38dc557

Browse files
loichyanmehalter
authored andcommitted
fix(status): prevent left padding from being overridden by children
1 parent 399e3d2 commit 38dc557

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/astroui/status/component.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function M.tabline_file_info(opts)
8080
name = "heirline_tabline_close_buffer_callback",
8181
},
8282
},
83-
padding = { left = 1, right = 1 },
83+
padding = { right = 1 },
8484
hl = function(self)
8585
local tab_type = self.tab_type
8686
if self._show_picker and self.tab_type ~= "buffer_active" then tab_type = "buffer_visible" end
@@ -428,9 +428,6 @@ end
428428
function M.builder(opts)
429429
opts = extend_tbl({ padding = { left = 0, right = 0 } }, opts)
430430
local children = {}
431-
if opts.padding.left > 0 then -- add left padding
432-
table.insert(children, { provider = status_utils.pad_string(" ", { left = opts.padding.left - 1 }) })
433-
end
434431
for key, entry in pairs(opts) do
435432
if
436433
type(key) == "number"
@@ -442,6 +439,9 @@ function M.builder(opts)
442439
end
443440
children[key] = entry
444441
end
442+
if opts.padding.left > 0 then -- add left padding
443+
table.insert(children, 1, { provider = status_utils.pad_string(" ", { left = opts.padding.left - 1 }) })
444+
end
445445
if opts.padding.right > 0 then -- add right padding
446446
table.insert(children, { provider = status_utils.pad_string(" ", { right = opts.padding.right - 1 }) })
447447
end

0 commit comments

Comments
 (0)