-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Account for viewport movement when wrapping over multiple rows #17353
Conversation
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.
Thanks for the quick fix!
Edit: Please don't feel forced to respond in depth, or even at all. I'm mostly just curious and it's not urgent. Only loosely related: Would it make things simpler here if we represent margins as 4 "insets" relative to the current (moving) viewport rectangle? For instance, |
Oh, and even looselier related: Assuming VtEngine is gone, and buffer snapshotting is implemented, which means that most things in Could we hypothetically move an accurate |
They are actually stored as relative coordinates, although not insets - they're relative to the top left of the page. But the
I'm not sure about that. If that's also got to include the |
Summary of the Pull Request
When we receive a stream of output at the bottom of the page that wraps
over more than two lines, that is expected to pan the viewport down by
multiple rows to accommodate all of the output. However, when the output
is received in a single write, that did not work correctly.
The problem was that we were reusing a
Page
instance across multiple_DoLineFeed
calls, and the viewport cached in thatPage
wasn't validafter the first call. This PR fixes the issue by adjusting the cached
viewport when we determine it has been moved by
_DoLineFeed
.References and Relevant Issues
The bug was introduced in PR #16615 when paging support was added.
Validation Steps Performed
I've verified that the test case in #17351 is now working correctly, and
have added a unit test covering this scenario.
PR Checklist