Grid.scrollDown pops newest history entry instead of oldest — corrupts history after compactionGrid.scrollDown pops newest history entry instead of oldest — corrupts history after compactionFile: src/grid.zig:148–157
Severity: CRITICAL
Status: ❌ FALSE POSITIVE / REVERTED — history.pop() (LIFO) is the intentional and correct order for restoring history lines. The FIFO modification proposed in this entry inverted scrollback restoration order and was reverted in Bug #249.
pub fn scrollDown(self: *Grid) Error!void {
if (self.height == 0 or self.history.items.len - self.history_start == 0) return;
var line = self.history.pop().?;
errdefer line.deinit(self.allocator);
self.getLineMut(self.height - 1).deinit(self.allocator);
self.start_index = (self.start_index + self.height - 1) % self.height;
self.getLineMut(0).* = line;
}
self.history.pop() pops the newest entry (last element of the ArrayList), which is the most recently scrolled-off line. The proposal in this bug entry to extract from history_start (FIFO) inverted history restoration order when scrolling down. Bug #249 reverted this change back to pop() (LIFO) as intentional behavior.