mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
term: reverse scroll: free scrolled out lines
This ensures *everything* in the circular scrollback history, after the bottom of the screen, is either NULL rows, or belong to the scrollback *history* (as opposed to the future history). This fixes an issue when calculating the scrollback start, which for example would trigger a crash when moving the viewport (i.e. scrolling with the mouse, or PgUp/PgDown). Closes #1190
This commit is contained in:
parent
43a48f53d4
commit
3d9a429499
1 changed files with 12 additions and 0 deletions
12
terminal.c
12
terminal.c
|
|
@ -2676,6 +2676,18 @@ term_scroll_reverse_partial(struct terminal *term,
|
|||
selection_scroll_down(term, rows);
|
||||
}
|
||||
|
||||
/* Unallocate scrolled out lines */
|
||||
for (int r = region.end - rows; r < region.end; r++) {
|
||||
const int abs_r = grid_row_absolute(term->grid, r);
|
||||
struct row *row = term->grid->rows[abs_r];
|
||||
|
||||
grid_row_free(row);
|
||||
term->grid->rows[abs_r] = NULL;
|
||||
|
||||
if (term->render.last_cursor.row == row)
|
||||
term->render.last_cursor.row = NULL;
|
||||
}
|
||||
|
||||
sixel_scroll_down(term, rows);
|
||||
|
||||
bool view_follows = term->grid->view == term->grid->offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue