diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 68999eda..3dbae47e 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -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, "")