Skip to content

Commit

Permalink
Fix print after Cls
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed Jan 21, 2024
1 parent d31d983 commit 5c002ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/vm/BasicConsoleView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ TScreenCell* BasicConsoleView::getCell(int16_t x, int16_t y) {

// If the cell doesn't exist, create it.
if (x >= 0 && static_cast<size_t>(x) >= row->size()) {
auto oldSize = row->size();
row->resize(x + 1);
auto newSize = row->size();

// Fill in the gap with the fill color.
TColorAttr fill{ fillColor, fillColor };
for (auto i = oldSize; i < newSize; i++) {
auto* cell = &row->at(i);
cell->attr = fill;
cell->_ch._text[0] = ' ';
cell->_ch._text[1] = '\0';
}
}

return &row->at(x);
Expand Down

0 comments on commit 5c002ca

Please sign in to comment.