fix(statuscolumn): return "" when no signs and no numbers are needed. Closes #570.

This commit is contained in:
Folke Lemaitre 2025-01-18 10:50:12 +01:00
parent cc72024d6c
commit c4980ef9b4
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -186,6 +186,9 @@ function M._get()
local win = vim.g.statusline_winid
local show_signs = vim.v.virtnum == 0 and vim.wo[win].signcolumn ~= "no"
local components = { "", LINE_NR, "" } -- left, middle, right
if not show_signs and not (vim.wo[win].number or vim.wo[win].relativenumber) then
return ""
end
if show_signs then
local buf = vim.api.nvim_win_get_buf(win)