mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-02 05:24:35 +02:00
fix(alpha): reset laststatus when alpha unloads. Fixes #1623
This commit is contained in:
parent
3c92fa4eb0
commit
30d573502a
1 changed files with 11 additions and 0 deletions
|
@ -316,11 +316,13 @@ return {
|
||||||
return dashboard
|
return dashboard
|
||||||
end,
|
end,
|
||||||
config = function(_, dashboard)
|
config = function(_, dashboard)
|
||||||
|
local laststatus = vim.o.laststatus
|
||||||
vim.o.laststatus = 0
|
vim.o.laststatus = 0
|
||||||
-- close Lazy and re-open when the dashboard is ready
|
-- close Lazy and re-open when the dashboard is ready
|
||||||
if vim.o.filetype == "lazy" then
|
if vim.o.filetype == "lazy" then
|
||||||
vim.cmd.close()
|
vim.cmd.close()
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
once = true,
|
||||||
pattern = "AlphaReady",
|
pattern = "AlphaReady",
|
||||||
callback = function()
|
callback = function()
|
||||||
require("lazy").show()
|
require("lazy").show()
|
||||||
|
@ -328,9 +330,18 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufUnload", {
|
||||||
|
once = true,
|
||||||
|
buffer = vim.api.nvim_get_current_buf(),
|
||||||
|
callback = function()
|
||||||
|
vim.opt.laststatus = laststatus
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
require("alpha").setup(dashboard.opts)
|
require("alpha").setup(dashboard.opts)
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
once = true,
|
||||||
pattern = "LazyVimStarted",
|
pattern = "LazyVimStarted",
|
||||||
callback = function()
|
callback = function()
|
||||||
local stats = require("lazy").stats()
|
local stats = require("lazy").stats()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue