refactor: add a ‘range’ struct, grouping a start and end coord together

This commit is contained in:
Daniel Eklöf 2022-04-09 15:09:02 +02:00
parent c7dd30742a
commit 5b1f1602bc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
7 changed files with 105 additions and 96 deletions

View file

@ -450,11 +450,11 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
if (term->search.match_len == 0)
return;
xassert(term->selection.end.row != -1);
xassert(term->selection.coords.end.row != -1);
const bool move_cursor = term->search.cursor == term->search.len;
const struct coord old_end = term->selection.end;
const struct coord old_end = term->selection.coords.end;
struct coord new_end = old_end;
struct row *row = NULL;