diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-07-16 14:45:36 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-07-18 14:14:21 +0000 |
| commit | 5f0ceb72f176caf7673ea1d4bc5195f26f4b4df7 (patch) | |
| tree | d5dc946ae5af95369f47924e041f161bc8ae6ee2 /selection.c | |
| parent | Merge branch 'refactor-shm-buffer-management' (diff) | |
csi: erase scrollback: cancel selection if it touches the scrollback
This breaks out the scrollback erasing logic for \E[3J from csi.c, and
moves it to the new function term_erase_scrollback(), and changes the
logic to calculate the start and end row (absolute) numbers of the
scrollback, and only iterate those, instead of iterating *all* rows,
filtering out those that are on-screen.
It also adds an intersection range check of the selection range, and
cancels the selection if it touches any of the deleted scrollback
rows.
This fixes a crash when trying to render the next frame, since the
selection now references rows that have been freed.
Closes #633
Diffstat (limited to 'selection.c')
| -rw-r--r-- | selection.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/selection.c b/selection.c index 57ab8bf6..537614f6 100644 --- a/selection.c +++ b/selection.c @@ -69,10 +69,8 @@ selection_on_rows(const struct terminal *term, int row_start, int row_end) end = tmp; } - if (row_start >= start->row && row_end <= end->row) { - LOG_INFO("ON ROWS"); + if (row_start >= start->row && row_end <= end->row) return true; - } return false; } |
