From be07856647d2b53132211adc82b359cff2b3b054 Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Thu, 4 Apr 2024 17:59:42 -0400 Subject: [PATCH] fix(terminal/Screen): selectionString multi-page Corrected logic for detecting if the current row is the end of the selection. Previous logic was faulty because when I calculated the current page y incorrectly, not realizing that it was already available as `y`. --- src/terminal/Screen.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index c9e468bed..b51f10764 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -1433,7 +1433,7 @@ pub fn selectionString(self: *Screen, alloc: Allocator, opts: SelectionString) ! } } - const is_final_row = sel_end.page == chunk.page and sel_end.y == chunk.start + row_count; + const is_final_row = chunk.page == sel_end.page and y == sel_end.y; if (!is_final_row and (!row.wrap or sel_ordered.rectangle))