Skip to content

Conversation

@daxian-dbw
Copy link
Member

Fix #884

There are mainly two changes:

  1. when clearing characters from previous physical lines, use _console.SetCursorPosition(0, _initialY + physicalLine) to move to the next line instead of Write("\n").
    this is because when the previous physical line is at the bottom of buffer height, _console.Write("\n") will scroll up the buffer and screw up the existing physical lines.
  2. when the cursor top exceeds the buffer height, call _console.Write("\n") to scroll up the buffer, and adjust _initialY and point.Y accordingly.

This is the behavior after this fix:

test

@daxian-dbw daxian-dbw requested a review from lzybkr April 16, 2019 23:58
@daxian-dbw daxian-dbw merged commit ef2f65f into PowerShell:master Apr 17, 2019
@daxian-dbw daxian-dbw deleted the fix branch April 17, 2019 01:47
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.

Long lines at the end of the buffer cause an exception

2 participants