render: selection may not be "ordered", since it may not have been finalized

This commit is contained in:
Daniel Eklöf 2019-08-08 17:58:06 +02:00
parent 83a10402af
commit 2a8962fd1a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -98,6 +98,12 @@ coord_is_selected(const struct terminal *term, int col, int row)
const struct coord *start = &term->selection.start;
const struct coord *end = &term->selection.end;
if (start->row > end->row || (start->row == end->row && start->col > end->col)) {
const struct coord *tmp = start;
start = end;
end = tmp;
}
assert(start->row <= end->row);
row += term->grid->view;