fix: memory corruption in Screen.cursorScrollAboveRotate

Unless it's guaranteed that the new pin is in the same page as the old
one, `cursor.page_pin` should only be updated through `cursorChangePin`,
not directly.
This commit is contained in:
Qwerasd
2024-12-24 22:47:38 -05:00
parent a387e680ed
commit 6d034d04a0

View File

@ -863,7 +863,7 @@ pub fn cursorScrollAbove(self: *Screen) !void {
}
fn cursorScrollAboveRotate(self: *Screen) !void {
self.cursor.page_pin.* = self.cursor.page_pin.down(1).?;
self.cursorChangePin(self.cursor.page_pin.down(1).?);
// Go through each of the pages following our pin, shift all rows
// down by one, and copy the last row of the previous page.