mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
feat(layout): static (non-flex) layouts now shrink the root box to fit the contents. See #2035
This commit is contained in:
parent
d91fc7d3fa
commit
ba7845bb85
1 changed files with 5 additions and 0 deletions
|
|
@ -363,6 +363,11 @@ function M:update_box(box, parent)
|
||||||
offset = offset + dims[c][size_main]
|
offset = offset + dims[c][size_main]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- if we still have free space, shrink the root box
|
||||||
|
if free_main > 0 and is_root then
|
||||||
|
orig_dim[size_main] = orig_dim[size_main] - free_main
|
||||||
|
end
|
||||||
|
|
||||||
-- update box win
|
-- update box win
|
||||||
local box_win = self.box_wins[box.id]
|
local box_win = self.box_wins[box.id]
|
||||||
if box_win then
|
if box_win then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue