From 2d40cb5f401ed1d4d812fb9c9478f14b1720138e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:23:27 +0300 Subject: [PATCH] fix(statuscolumn): `%r` deprecated in nightly and `%l` handles everything --- lua/lazyvim/util/ui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 1ad2b6f0..f14096db 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -140,10 +140,14 @@ function M.statuscolumn() 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 + if vim.fn.has("nvim-0.11") == 1 then + components[2] = "%l" -- 0.11 handles both the current and other lines with %l else - components[2] = is_relnum and "%r" or "%l" -- other lines + 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 end components[2] = "%=" .. components[2] .. " " -- right align end