From 8d36fb9edc19b5b68a1664fde4b3d196614b86ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Feb 2022 13:07:31 +0530 Subject: [PATCH] Fix copying of selection after selection has been scrolled off history buffer raising an error Fixes #4713 --- docs/changelog.rst | 2 ++ kitty/screen.c | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 272fde7b9..a5e314b2f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -148,6 +148,8 @@ Detailed list of changes - macOS: Fix the mouse cursor being set to arrow after switching desktops or toggling full screen (:pull:`4716`) +- Fix copying of selection after selection has been scrolled off history buffer raising an error (:iss:`4713`) + 0.24.2 [2022-02-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/screen.c b/kitty/screen.c index c73b902d5..56961182b 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2334,6 +2334,7 @@ iteration_data(const Screen *self, const Selection *sel, IterationData *ans, int ans->y += self->scrolled_by; ans->y_limit += self->scrolled_by; } ans->y = MAX(ans->y, min_y); + ans->y_limit = MAX(ans->y, ans->y_limit); // iteration is from y to y_limit } static XRange