Compare commits

...

1 Commits

Author SHA1 Message Date
PankajBhojwani
2096fa5e1f Use ROW.Reset in EraseInDisplay instead of printing millions of spaces per line #2197 2019-08-01 13:48:51 -07:00

View File

@@ -337,11 +337,9 @@ bool Terminal::EraseInDisplay(const DispatchTypes::EraseType eraseType)
// and we have to make sure we erase that text // and we have to make sure we erase that text
auto eraseStart = _mutableViewport.Height(); auto eraseStart = _mutableViewport.Height();
auto eraseEnd = _buffer->GetLastNonSpaceCharacter(_mutableViewport).Y; auto eraseEnd = _buffer->GetLastNonSpaceCharacter(_mutableViewport).Y;
auto eraseIter = OutputCellIterator(UNICODE_SPACE, _buffer->GetCurrentAttributes(), _mutableViewport.RightInclusive() * (eraseEnd - eraseStart + 1));
for (SHORT i = eraseStart; i <= eraseEnd; i++) for (SHORT i = eraseStart; i <= eraseEnd; i++)
{ {
COORD erasePos{ 0, i }; _buffer->GetRowByOffset(i).Reset(_buffer->GetCurrentAttributes());
_buffer->Write(eraseIter, erasePos);
} }
// Reset the scroll offset now because there's nothing for the user to 'scroll' to // Reset the scroll offset now because there's nothing for the user to 'scroll' to