Improve RecomputeInitialCoords
to be more robust and handle a couple special cases
#3074
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.
PR Summary
Fix #2984
Fix
PhysicalLineCount
to take into account that double-cell character may get wrapped to the next line when it cannot fit in the current physical line.Fix #2954
Handle the special case where the screen is cleared by a terminal UI utility in
RecomputeInitialCoords
.Fix #1884
Improve
RecomputeInitialCoords
by using the old cursor position in the rendered text on screen to calculate the new initial coordinates when there is any change to_buffer
and_current
. Before this change, we always depend on_buffer
and_current
to re-calculate the new initial coordinates, but_buffer
and_current
may have changed when we are doing the re-calculation, for example,Escape
is pressed to revert line, in which case_buffer
will be reset and_current
will be 0. That would result in wrong calculation and exception being thrown.Fix #1456
Improve
RecomputeInitialCoords
to handle themax-size => normal-size => max-size
resizing.PR Checklist
Microsoft Reviewers: Open in CodeFlow