mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 18:26:13 +03:00
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:
@ -2093,21 +2093,18 @@ pub fn eraseRows(
|
|||||||
const old_dst = dst.*;
|
const old_dst = dst.*;
|
||||||
dst.* = src.*;
|
dst.* = src.*;
|
||||||
src.* = old_dst;
|
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
|
// Clear our remaining cells that we didn't shift or swapped
|
||||||
// // in case we grow back into them.
|
// in case we grow back into them.
|
||||||
// for (scroll_amount..chunk.page.data.size.rows) |i| {
|
for (scroll_amount..chunk.page.data.size.rows) |i| {
|
||||||
// const row: *Row = &rows[i];
|
const row: *Row = &rows[i];
|
||||||
// chunk.page.data.clearCells(
|
chunk.page.data.clearCells(
|
||||||
// row,
|
row,
|
||||||
// 0,
|
0,
|
||||||
// chunk.page.data.size.cols,
|
chunk.page.data.size.cols,
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// Update any tracked pins to shift their y. If it was in the erased
|
// 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.
|
// row then we move it to the top of this page.
|
||||||
|
Reference in New Issue
Block a user