mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 10:16:12 +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.*;
|
||||
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.
|
||||
|
Reference in New Issue
Block a user