From cc69a9304bfdd047b7ea9ffa879985c351c6327b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 Oct 2025 16:16:31 +0200 Subject: [PATCH] fix(dashboard): restore showtabline/laststatus when entering another non-float window. Closes #1774 --- lua/snacks/dashboard.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lua/snacks/dashboard.lua b/lua/snacks/dashboard.lua index 5833f469..90e10e2f 100644 --- a/lua/snacks/dashboard.lua +++ b/lua/snacks/dashboard.lua @@ -1193,13 +1193,28 @@ function M.setup() local options = { showtabline = vim.o.showtabline, laststatus = vim.o.laststatus } vim.o.showtabline, vim.o.laststatus = 0, 0 local dashboard = M.open({ buf = buf, win = wins[1] }) - D.on("Closed", function() + + local function restore() for k, v in pairs(options) do if vim.o[k] == 0 and v ~= 0 then vim.o[k] = v end end - end, dashboard.augroup) + options = {} + end + + D.on("Closed", restore, dashboard.augroup) + + vim.api.nvim_create_autocmd("WinEnter", { + group = dashboard.augroup, + callback = function() + local win = vim.api.nvim_get_current_win() + local is_float = vim.api.nvim_win_get_config(win).relative ~= "" + if win ~= dashboard.win and not is_float then + restore() + end + end, + }) if Snacks.config.dashboard.debug then Snacks.debug.stats({ min = 0.2 })