mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-11 04:27:49 -05:00
render: selection may not be "ordered", since it may not have been finalized
This commit is contained in:
parent
83a10402af
commit
2a8962fd1a
1 changed files with 6 additions and 0 deletions
6
render.c
6
render.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue