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
+3 -4
View File
@@ -9,7 +9,6 @@ opt.autoindent = true
-- UI -- UI
opt.number = true opt.number = true
opt.relativenumber = false
opt.termguicolors = true opt.termguicolors = true
opt.laststatus = 3 opt.laststatus = 3
opt.wrap = false opt.wrap = false
@@ -27,7 +26,7 @@ opt.backupcopy = "yes"
-- Neovide -- Neovide
if vim.g.neovide then if vim.g.neovide then
vim.opt.guifont = { "ComicCode Nerd Font", ":h16" } vim.opt.guifont = { "ComicCode Nerd Font", ":h16" }
vim.g.neovide_scale_factor = 1.0 vim.g.neovide_scale_factor = 1.0
vim.g.neovide_scroll_animation_length = 0.3 vim.g.neovide_scroll_animation_length = 0.3
end end
+17 -3
View File
@@ -90,6 +90,14 @@ local function open()
end end
local win = vim.api.nvim_get_current_win() 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].number = false
vim.wo[win].relativenumber = false vim.wo[win].relativenumber = false
vim.wo[win].signcolumn = "no" vim.wo[win].signcolumn = "no"
@@ -101,12 +109,18 @@ local function open()
local prev_showtabline = vim.o.showtabline local prev_showtabline = vim.o.showtabline
vim.o.showtabline = 0 vim.o.showtabline = 0
-- Restore tabline only when the dashboard buffer is actually gone, not just -- Restore tabline and window options only when the dashboard buffer is
-- when focus moves away (e.g. opening oil sidebar). BufLeave fires too eagerly. -- actually gone, not just when focus moves away (e.g. opening oil sidebar).
-- BufLeave fires too eagerly.
vim.api.nvim_create_autocmd({ "BufWipeout", "BufHidden" }, { vim.api.nvim_create_autocmd({ "BufWipeout", "BufHidden" }, {
buffer = buf, buffer = buf,
once = true, 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) render(buf, win)