Fix keyboard hint labels on wrapped and scrolled content - #1885
Open
raphamorim wants to merge 1 commit into
Open
raphamorim wants to merge 1 commit into
raphamorim wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.