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.
open_link_attakes aposand then doeslet _ = 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 aCellPostype, and the selection code does the same conversion — it needs element-local bounds, which is the partopen_link_atpunted on.Found while reviewing #2.