Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
lhecker
approved these changes
Feb 18, 2026
Member
|
Ah whoops, I thought I had already reviewed it last week and just re-approved it. Dejavu? |
lhecker
approved these changes
Feb 23, 2026
Comment on lines
+529
to
+530
| const auto beg = std::max<til::CoordType>(0, bufferPos.y - viewportHeight); | ||
| const auto end = std::min(bufferSize.BottomInclusive(), bufferPos.y + viewportHeight); |
Member
There was a problem hiding this comment.
I think we should move the min/max into UTextFromTextBuffer itself so that all callers are protected. Then, we can simplify the code here by dropping the min/max.
BTW why doesn't this function use the cached _patternIntervalTree?
Comment on lines
+1202
to
+1206
| // GH#18177: Scan extra rows beyond the viewport so that URLs | ||
| // wrapping across the viewport boundary are matched in full | ||
| const auto bufferSize = _activeBuffer().GetSize(); | ||
| const auto beg = std::max<til::CoordType>(0, visStart - viewportHeight); | ||
| const auto end = std::min(bufferSize.BottomInclusive(), visEnd + viewportHeight); |
Member
There was a problem hiding this comment.
Should we trim the results? For instance, we could pass both a start/end range for search, as well as a start/end range for filtering the search to _getPatterns.
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.
Summary of the Pull Request
Fixes a bug where a partially visible URL would not be detected. This is fixed by expanding the search space by 1 viewport height in both directions.
The
_patternIntervalTreenow operates in the absolute-buffer space as opposed to the viewport-relative space. It's a bit of an annoying change, but the alternative would be to keep track of the offset used by the method above, which I find more annoying, personally. As a part of this change, I made it a bit more clear when something is viewport-relative vs buffer-absolute.Regarding mark mode hyperlink navigation, now that everything is in the absolute-buffer space, I'm able to fix some of the issues in #13854. I removed
_selectionIsTargetingUrland fixed/validated navigating to hyperlinks that are partially visible.Validation Steps Performed
Detects URL that is...
✅ fully visible
✅ partially cropped off the top
✅ partially cropped off the bottom
✅ Above scenarios work with mark mode hyperlink navigation
✅Tests added
Closes #18177
Closes #13854