luukvbaal / statuscol.nvim

Status column plugin that provides a configurable 'statuscolumn' and click handlers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Relative line number always shows current line number as 0

cdmill opened this issue · comments

As shown in the image below, statuscol is always showing the current line as 0. Not exactly sure if this is due to my config or other reasons, or if anyone else is having this problem.

sc 2023-10-20 at 10 02 16

In builtin.lua the following change fixes the problem for me:

function M.lnumfunc(args, fa)
  if args.sclnu and fa.sign and fa.sign.wins[args.win].signs[args.lnum] then
    return "%="..M.signfunc(args, fa)
  end
  if not args.rnu and not args.nu then return "" end
  if args.virtnum ~= 0 then return "%=" end

  local lnum = args.rnu and (args.relnum > 0 and args.relnum
+   or (args.nu and args.lnum)) or args.lnum
-   or (args.nu and args.lnum or 0)) or args.lnum

If you want I can submit a PR, but it's a pretty small change as it is. I haven't exactly tested if there are any unwanted side-effects from this change, but as far as I can tell everything is working fine.

SOLVED: was from an outside issue.