diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-04-12 14:39:54 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-04-12 15:57:53 +0000 |
| commit | e2baa6523875aaa13b6b7db80b7985978b8ee492 (patch) | |
| tree | 9b2feeee33de07f1fe500a72563cb88b0f73f21f /render.c | |
| parent | meson: bump tllist dependency version to 1.1.0 (diff) | |
render: ensure scroll region’s endpoint is valid after a window resize
If we had a non-empty bottom scroll region, and the window was resized
to a smaller size, the scroll region was not reset correctly.
This led to a crash when scrolling the screen content.
Fix by making sure the scroll region’s endpoint is within range.
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -4128,8 +4128,7 @@ maybe_resize(struct terminal *term, int width, int height, bool force) if (term->scroll_region.start >= term->rows) term->scroll_region.start = 0; - - if (term->scroll_region.end >= old_rows) + if (term->scroll_region.end > term->rows) term->scroll_region.end = term->rows; term->render.last_cursor.row = NULL; |
