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`.
This commit is contained in:
Qwerasd
2024-04-04 17:59:42 -04:00
parent b03f80cadd
commit be07856647

View File

@ -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))