Skip to content

Commit

Permalink
fix(dashboard): load dashboard when closing lazy if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 24, 2024
1 parent faee8ce commit fa2fc64
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lua/lazyvim/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,15 @@ return {
button.key_format = " %s"
end

-- close Lazy and re-open when the dashboard is ready
-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
require("lazy").show()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
Expand Down

0 comments on commit fa2fc64

Please sign in to comment.