Skip to content

open_link_at ignores the click position #8

Description

@zackham

open_link_at takes a pos and then does let _ = pos; — it opens the single OSC-8 hyperlink on screen, else the first http(s) one anywhere in the grid, else the first bare URL in the visible cells. So ctrl+click opens a link on the pane, not the link under the cursor.

#2 took middle-click off this path (it now pastes PRIMARY), which removes the worst of the surprise, but ctrl+click still has it: with two URLs on screen you can't open the second one.

Fix is pixel→cell for the click, then hit-test the hyperlink spans / URL regex on that cell. The view already has cell_metrics(window) and a CellPos type, and the selection code does the same conversion — it needs element-local bounds, which is the part open_link_at punted on.

Found while reviewing #2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions