selection: add a selection API

This commit is contained in:
Daniel Eklöf 2019-07-11 09:51:51 +02:00
parent 1c861e5d69
commit bcf763d417
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 117 additions and 30 deletions

View file

@ -14,11 +14,26 @@
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
void
term_damage_rows(struct terminal *term, int start, int end)
{
assert(start <= end);
for (int r = start; r <= end; r++)
grid_row(term->grid, r)->dirty = true;
}
void
term_damage_rows_in_view(struct terminal *term, int start, int end)
{
assert(start <= end);
for (int r = start; r <= end; r++)
grid_row_in_view(term->grid, r)->dirty = true;
}
void
term_damage_all(struct terminal *term)
{
for (int i = 0; i < term->rows; i++)
grid_row(term->grid, i)->dirty = true;
term_damage_rows(term, 0, term->rows);
}
void