mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +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"
|
button.key_format = " %s"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- close Lazy and re-open when the dashboard is ready
|
-- open dashboard after closing lazy
|
||||||
if vim.o.filetype == "lazy" then
|
if vim.o.filetype == "lazy" then
|
||||||
vim.cmd.close()
|
vim.api.nvim_create_autocmd("WinClosed", {
|
||||||
vim.api.nvim_create_autocmd("User", {
|
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||||
pattern = "DashboardLoaded",
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
require("lazy").show()
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue