style: adjust layout padding based on window height

This commit is contained in:
2024-09-14 22:16:20 -04:00
parent 3d758d1ebc
commit 70c3f4dc44
+7 -2
View File
@@ -50,8 +50,13 @@ M.alpha = {
end end
dashboard.section.header.opts.hl = "Conditional" dashboard.section.header.opts.hl = "Conditional"
dashboard.section.footer.opts.hl = "AlphaFooter" dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = local padding = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) if vim.fn.winheight(0) < 40 then
padding = 1
elseif vim.fn.winheight(0) < 30 then
padding = 0
end
dashboard.opts.layout[1].val = padding
return dashboard return dashboard
end, end,
} }