Fix numberline

This commit is contained in:
2026-04-17 14:21:32 -07:00
parent b53f4a2a3c
commit 08b6a1dcf7
2 changed files with 20 additions and 7 deletions
-1
View File
@@ -9,7 +9,6 @@ opt.autoindent = true
-- UI
opt.number = true
opt.relativenumber = false
opt.termguicolors = true
opt.laststatus = 3
opt.wrap = false
+17 -3
View File
@@ -90,6 +90,14 @@ local function open()
end
local win = vim.api.nvim_get_current_win()
local prev_wo = {
number = vim.wo[win].number,
relativenumber = vim.wo[win].relativenumber,
signcolumn = vim.wo[win].signcolumn,
cursorline = vim.wo[win].cursorline,
list = vim.wo[win].list,
statuscolumn = vim.wo[win].statuscolumn,
}
vim.wo[win].number = false
vim.wo[win].relativenumber = false
vim.wo[win].signcolumn = "no"
@@ -101,12 +109,18 @@ local function open()
local prev_showtabline = vim.o.showtabline
vim.o.showtabline = 0
-- Restore tabline only when the dashboard buffer is actually gone, not just
-- when focus moves away (e.g. opening oil sidebar). BufLeave fires too eagerly.
-- Restore tabline and window options only when the dashboard buffer is
-- actually gone, not just when focus moves away (e.g. opening oil sidebar).
-- BufLeave fires too eagerly.
vim.api.nvim_create_autocmd({ "BufWipeout", "BufHidden" }, {
buffer = buf,
once = true,
callback = function() vim.o.showtabline = prev_showtabline end,
callback = function()
vim.o.showtabline = prev_showtabline
if vim.api.nvim_win_is_valid(win) then
for k, v in pairs(prev_wo) do vim.wo[win][k] = v end
end
end,
})
render(buf, win)