-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the location that selecting a mark uses #17138
Conversation
I think this subtly regressed in `Terminal::SelectNewRegion` is the only thing that uses the return value from `Terminal::_ScrollToPoints`. Before that PR, `_ScrollToPoints` was just a part of `SelectNewRegion`, and it moved the start & end coords by the `_VisibleStartIndex`, not the `_scrollOffset`. Kinda weird there weren't any _other_ tests for `SelectNewRegion`? I also caught a second bug while I was here - If you had a line with an exact wrap, and tried to select that like with selectOutput, we'd explode. Closes #17131
@@ -199,7 +199,7 @@ til::CoordType Terminal::_ScrollToPoints(const til::point coordStart, const til: | |||
_NotifyScrollEvent(); | |||
} | |||
|
|||
return _scrollOffset; | |||
return _VisibleStartIndex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also update the comment? It currently reads:
// Return Value:
// - The updated scroll offset
BTW, as someone new to this repo I have a doubt: what's the mutable viewport? And how does it differ from the viewport that _scrollOffset
represents?
Not the best place to ask questions, so I'm sorry 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PUT THIS IN THE REPO SOMEWHERE
I think this subtly regressed in #16611. Jump to 90b8bb7#diff-f9112caf8cb75e7a48a7b84987724d754181227385fbfcc2cc09a879b1f97c12L171-L223
Terminal::SelectNewRegion
is the only thing that uses the return value fromTerminal::_ScrollToPoints
. Before that PR,_ScrollToPoints
was just a part ofSelectNewRegion
, and it moved the start & end coords by the_VisibleStartIndex
, not the_scrollOffset
.Kinda weird there weren't any other tests for
SelectNewRegion
?I also caught a second bug while I was here - If you had a line with an exact wrap, and tried to select that like with selectOutput, we'd explode.
Closes #17131