fix(dashboard): load dashboard when closing lazy if needed
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user