selection: selection_on_rows(): use scrollback relative coords

When checking if the current selection intersects with the
region (passed as parameter to the function), use scrollback relative
coordinates.

This fixes an issue where selections crossing the scrollback
wrap-around being misdetected, resulting in either the selection being
canceled while scrolling, even though it wasn’t scrolled out, or the
selection _not_ being canceled, when it _was_ scrolled out.
This commit is contained in:
Daniel Eklöf 2022-07-28 18:27:13 +02:00
parent 632c4839cd
commit a05eaf28bd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 68 additions and 21 deletions

View file

@ -22,6 +22,8 @@ void selection_extend(
bool selection_on_rows(const struct terminal *term, int start, int end);
void selection_scroll_up(struct terminal *term, int rows);
void selection_scroll_down(struct terminal *term, int rows);
void selection_view_up(struct terminal *term, int new_view);
void selection_view_down(struct terminal *term, int new_view);