mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +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)
|
||||
return true
|
||||
end)
|
||||
self.on("UpdatePre", close)
|
||||
self.on("Closed", close)
|
||||
self.on("UpdatePre", close, self.augroup)
|
||||
self.on("Closed", close, self.augroup)
|
||||
self:trace()
|
||||
end,
|
||||
text = ("\n"):rep(height - 1),
|
||||
|
@ -1049,13 +1049,14 @@ function M.setup()
|
|||
|
||||
local options = { showtabline = vim.o.showtabline, laststatus = vim.o.laststatus }
|
||||
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
|
||||
if vim.o[k] == 0 and v ~= 0 then
|
||||
vim.o[k] = v
|
||||
end
|
||||
end
|
||||
end)
|
||||
end, dashboard.augroup)
|
||||
|
||||
if Snacks.config.dashboard.debug then
|
||||
Snacks.debug.stats({ min = 0.2 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue