range-highlight.nvim icon indicating copy to clipboard operation
range-highlight.nvim copied to clipboard

Relative range selection query

Open benfrain opened this issue 3 years ago • 2 comments

Using a range selection like :-15,-10 I expected to have the lines starting 15 lines above my cursor, to 10 lines above my cursor highlighted.

However, I actually get the line 15 above, plus another 10 behind that; as if it's doing the sum -15 - -10 so I get 10 lines instead of 5.

Is that the expected behaviour?

benfrain avatar Jun 30 '21 14:06 benfrain

Hi thank you for reporting. This is a bug I suppose, and I think it is the reverse range logic messing up there.

winston0410 avatar Jul 30 '21 21:07 winston0410

@benfrain It seems like the bug would occurs whenever the relative range are both negative. Good catch and I will try to fix it when I have time.

winston0410 avatar Jul 30 '21 21:07 winston0410