Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

One too many lines highlighted when whole lines are selected #74

@phoenixeliot

Description

@phoenixeliot

This is for the feature "Open on Github: File" with lines selected/highlighted.

Say you have 20 lines of text.
You put the cursor at the start of line 10, then hold shift and press down 5 times, so visually lines 10–14 are selected, but the cursor is technically on line 15 (even though it's not visible).
You then trigger "Open on Github: File".

Currently, the github URL has the line numbers #L10-L15, which includes line 15 in the highlight, even though it wasn't visually selected in the editor.

Better would probably be to not include the last line if nothing on that line is actually selected.

This occurs for me especially often because I use vim-mode, which allows selecting by whole lines, which acts identically to the repro steps I gave in terms of where the selector bounds are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions