Fix numberline
This commit is contained in:
@@ -9,7 +9,6 @@ opt.autoindent = true
|
||||
|
||||
-- UI
|
||||
opt.number = true
|
||||
opt.relativenumber = false
|
||||
opt.termguicolors = true
|
||||
opt.laststatus = 3
|
||||
opt.wrap = false
|
||||
@@ -27,7 +26,7 @@ opt.backupcopy = "yes"
|
||||
|
||||
-- Neovide
|
||||
if vim.g.neovide then
|
||||
vim.opt.guifont = { "ComicCode Nerd Font", ":h16" }
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
vim.g.neovide_scroll_animation_length = 0.3
|
||||
vim.opt.guifont = { "ComicCode Nerd Font", ":h16" }
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
vim.g.neovide_scroll_animation_length = 0.3
|
||||
end
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user