ben-gibson/GitLink

End of selection is off by one when selecting lines

Opened this issue · 0 comments

Thank you for this fantastic plugin!

One nit is that I often select a bunch of lines (for example using Ctrl+w to expand the selection), and the resulting link created by GitLink includes the last line, even though I've not selected anything on that line. The last selected character is the newline before that line.

A couple of screenshots should clarify. I've triple-clicked line 12 to select that line:

image

If I right-click and press "Open in GitHub" (same result on GitLab), it goes to this page, where the next line is also selected:

image