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
PhysicalLineCountto 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
RecomputeInitialCoordsby using the old cursor position in the rendered text on screen to calculate the new initial coordinates when there is any change to_bufferand_current. Before this change, we always depend on_bufferand_currentto re-calculate the new initial coordinates, but_bufferand_currentmay have changed when we are doing the re-calculation, for example,Escapeis pressed to revert line, in which case_bufferwill be reset and_currentwill be 0. That would result in wrong calculation and exception being thrown.Fix #1456
Improve
RecomputeInitialCoordsto handle themax-size => normal-size => max-sizeresizing.PR Checklist
Microsoft Reviewers: Open in CodeFlow