veler / CopyGitLink

Copy links to files or selections to GitHub and Azure DevOps directly from Visual Studio's text editor, Solution Explorer and document tab.
https://marketplace.visualstudio.com/items?itemName=EtienneBAUDOUX.CopyGitLink
MIT License
42 stars 9 forks source link

Line selection gets a link with +1 lines included #12

Open AArnott opened 2 years ago

AArnott commented 2 years ago

When I select an entire line (by clicking in the left margin of the editor) and copy git link, I get a link that includes the line after the selection. Can that be omitted?

veler commented 2 years ago

Thanks @AArnott !

Note to myself: this happen because the selection ends on the next line. See the caret position here:

image

This could be fixed by checking if the selection span in the last selected line is empty.