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.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
-- close and re-open Lazy after showing alpha
vim.cmd.close()
alpha.setup(dashboard.opts)
require("lazy").show()
else
alpha.setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function()
require("lazy").show()
end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",