From 94d773a26273e9e546c58467a2341a4a5110ad6a Mon Sep 17 00:00:00 2001 From: Piotr Kocia Date: Sat, 14 Jun 2025 02:01:25 +0200 Subject: [PATCH] fix selection outside view crashes --- terminal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 080e0854..a75c3593 100644 --- a/terminal.c +++ b/terminal.c @@ -2498,7 +2498,11 @@ term_damage_cell(struct terminal* const term, int const row, int const col) void term_damage_cell_in_view(struct terminal* const term, int const row, int const col) { - if(col >= term->grid->num_cols || col < 0) { + if(col >= term->cols || col < 0) { + return; + } + + if(row >= term->rows || row < 0) { return; }