fix(alpha): make alpha and lazy ui behave with each other

This commit is contained in:
Folke Lemaitre 2023-01-03 21:05:44 +01:00
parent bf8f5b31f3
commit aae683f868
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -142,16 +142,18 @@ return {
dashboard.section.buttons.opts.hl = "AlphaButtons" dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.opts.layout[1].val = 8 dashboard.opts.layout[1].val = 8
local alpha = require("alpha") -- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then if vim.o.filetype == "lazy" then
-- close and re-open Lazy after showing alpha
vim.cmd.close() vim.cmd.close()
alpha.setup(dashboard.opts) vim.api.nvim_create_autocmd("User", {
require("lazy").show() pattern = "AlphaReady",
else callback = function()
alpha.setup(dashboard.opts) require("lazy").show()
end,
})
end end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", { vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted", pattern = "LazyVimStarted",