From 670daaadc38daf801e59a516e8f76a17e90e526b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 1 Jan 2023 12:53:33 +0100 Subject: [PATCH] fix(alpha): make sure alpha renders when Lazy is open after installing missing plugins --- lua/plugins/ui.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 80270de1..c75e08c4 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -98,13 +98,16 @@ return { dashboard.section.buttons.opts.hl = "AlphaButtons" dashboard.opts.layout[1].val = 8 - if vim.bo[0].filetype == "lazy" then - vim.notify("Missing plugins installed!", vim.log.levels.INFO, { title = "LazyVim" }) + if vim.o.filetype == "lazy" then + -- close and re-open Lazy after showing alpha + vim.notify("Missing plugins installed!", vim.log.levels.INFO, { title = "lazy.nvim" }) vim.cmd.close() + require("alpha").setup(dashboard.opts) + require("lazy").show() + else + require("alpha").setup(dashboard.opts) end - require("alpha").setup(dashboard.opts) - vim.api.nvim_create_autocmd("User", { pattern = "LazyVimStarted", callback = function()