perf: Gitsigns travels when using wrap=true

This commit is contained in:
grChad 2023-11-08 21:07:04 -05:00
parent 68ff818a5b
commit 5b75c00ae0

View file

@ -120,13 +120,14 @@ function M.statuscolumn()
-- They show when either number or relativenumber is true
local is_num = vim.wo[win].number
local is_relnum = vim.wo[win].relativenumber
if (is_num or is_relnum) and vim.v.virtnum == 0 then
if vim.v.relnum == 0 then
components[2] = is_num and "%l" or "%r" -- the current line
else
components[2] = is_relnum and "%r" or "%l" -- other lines
end
components[2] = "%=" .. components[2] .. " " -- right align
if is_num and is_relnum then
components[2] = '%=%{v:relnum?(v:virtnum>0?"":v:relnum):(v:virtnum>0?"":v:lnum)} '
elseif is_num and not is_relnum then
components[2] = '%=%{v:virtnum>0?"":v:lnum} '
elseif is_relnum and not is_num then
components[2] = '%=%{v:virtnum>0?"":v:relnum} '
else
components[2] = ""
end
return table.concat(components, "")