mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 11:18:26 +00:00
perf(dashboard): properly cleanup autocmds
This commit is contained in:
parent
3c1849a09b
commit
8e6d977ec9
1 changed files with 5 additions and 4 deletions
|
@ -962,8 +962,8 @@ function M.sections.terminal(opts)
|
||||||
pcall(vim.fn.jobstop, jid)
|
pcall(vim.fn.jobstop, jid)
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
self.on("UpdatePre", close)
|
self.on("UpdatePre", close, self.augroup)
|
||||||
self.on("Closed", close)
|
self.on("Closed", close, self.augroup)
|
||||||
self:trace()
|
self:trace()
|
||||||
end,
|
end,
|
||||||
text = ("\n"):rep(height - 1),
|
text = ("\n"):rep(height - 1),
|
||||||
|
@ -1049,13 +1049,14 @@ function M.setup()
|
||||||
|
|
||||||
local options = { showtabline = vim.o.showtabline, laststatus = vim.o.laststatus }
|
local options = { showtabline = vim.o.showtabline, laststatus = vim.o.laststatus }
|
||||||
vim.o.showtabline, vim.o.laststatus = 0, 0
|
vim.o.showtabline, vim.o.laststatus = 0, 0
|
||||||
M.open({ buf = buf, win = wins[1] }).on("Closed", function()
|
local dashboard = M.open({ buf = buf, win = wins[1] })
|
||||||
|
D.on("Closed", function()
|
||||||
for k, v in pairs(options) do
|
for k, v in pairs(options) do
|
||||||
if vim.o[k] == 0 and v ~= 0 then
|
if vim.o[k] == 0 and v ~= 0 then
|
||||||
vim.o[k] = v
|
vim.o[k] = v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end, dashboard.augroup)
|
||||||
|
|
||||||
if Snacks.config.dashboard.debug then
|
if Snacks.config.dashboard.debug then
|
||||||
Snacks.debug.stats({ min = 0.2 })
|
Snacks.debug.stats({ min = 0.2 })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue