mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(dashboard): load dashboard when closing lazy if needed
This commit is contained in:
parent
faee8ce581
commit
fa2fc64031
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue