fix potential crash

This commit is contained in:
Mitchell Hashimoto
2022-09-13 10:12:29 -07:00
parent 0801786d51
commit b5f9e8abf0

View File

@ -416,7 +416,7 @@ pub fn rebuildCells(self: *Grid, term: *Terminal) !void {
// Get our new length and cache the cells. // Get our new length and cache the cells.
try row_cells.ensureTotalCapacity(self.alloc, term.screen.cols); try row_cells.ensureTotalCapacity(self.alloc, term.screen.cols);
row_cells.clearRetainingCapacity(); row_cells.clearRetainingCapacity();
row_cells.appendSliceAssumeCapacity(self.cells.items[start..]); try row_cells.appendSlice(self.alloc, self.cells.items[start..]);
// Set row is not dirty anymore // Set row is not dirty anymore
row.setDirty(false); row.setDirty(false);