From 9a80ab0700d0f6d43794270520e0bd1dbd34048f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Sep 2020 10:42:30 +0530 Subject: [PATCH] More robust --- kitty/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/screen.c b/kitty/screen.c index 38c5fe40b..dd53a66f8 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2476,7 +2476,7 @@ screen_is_selection_dirty(Screen *self) { void screen_start_selection(Screen *self, index_type x, index_type y, bool in_left_half_of_cell, bool rectangle_select, SelectionExtendMode extend_mode) { #define A(attr, val) self->selections.items->attr = val; - ensure_space_for(&self->selections, items, Selection, 1, capacity, 1, false); + ensure_space_for(&self->selections, items, Selection, self->selections.count + 1, capacity, 1, false); memset(self->selections.items, 0, sizeof(Selection)); self->selections.count = 1; self->selections.in_progress = true;