fix(terminal): clear erased rows

Clearing these rows is necessary to avoid memory corruption, but the
calls to `clearCells` in the first loop were redundant, since the rows
in question are included in the second loop as well.
This commit is contained in:
Qwerasd
2024-03-25 14:54:49 -06:00
parent 0a6ef3fda4
commit 9df9c999a7

View File

@ -2093,21 +2093,18 @@ pub fn eraseRows(
const old_dst = dst.*;
dst.* = src.*;
src.* = old_dst;
// // Clear the old data in case we reuse these cells.
// chunk.page.data.clearCells(src, 0, chunk.page.data.size.cols);
}
// // Clear our remaining cells that we didn't shift or swapped
// // in case we grow back into them.
// for (scroll_amount..chunk.page.data.size.rows) |i| {
// const row: *Row = &rows[i];
// chunk.page.data.clearCells(
// row,
// 0,
// chunk.page.data.size.cols,
// );
// }
// Clear our remaining cells that we didn't shift or swapped
// in case we grow back into them.
for (scroll_amount..chunk.page.data.size.rows) |i| {
const row: *Row = &rows[i];
chunk.page.data.clearCells(
row,
0,
chunk.page.data.size.cols,
);
}
// Update any tracked pins to shift their y. If it was in the erased
// row then we move it to the top of this page.