Skip to content

Fix keyboard hint labels on wrapped and scrolled content - #1885

Open
raphamorim wants to merge 1 commit into
mainfrom
hint-labels-logical-line
Open

raphamorim wants to merge 1 commit into
mainfrom
hint-labels-logical-line

Conversation

@raphamorim

Copy link
Copy Markdown
Owner

Follow-up to #1884, porting the keyboard hint mode (the labeled-jump flow) onto the same logical-line matching the hover path now uses.

The label finder had the same two defects the hover path had, plus one of its own: it searched one visual row at a time, so soft-wrapped URLs matched truncated or produced no label; byte-versus-cell drift shifted label anchors right of the match when multi-byte characters preceded it; and it skipped any line with a negative grid index, so hint mode showed no labels at all for scrollback content while the view was scrolled.

find_regex_matches now walks the viewport one logical line at a time, in grid coordinates, so scrolled views resolve. Each anchor extracts the unwrapped line with the byte-to-cell map and collects all matches through LogicalLine::matches, which the hover path's match_at is now a filter over, so both paths share one implementation, including tail post-processing, the per-search retry budget, and wide-character end extension. Wrap chains longer than the scan bound are re-anchored in tiles; overlapping tiles can produce a duplicate match, which the existing sort plus dedup in update_matches collapses.

New tests cover a soft-wrapped URL yielding a single match with cell-exact bounds spanning both rows, and label alignment with multi-byte prefixes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant