aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-11 07:51:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-11 15:38:01 +0000
commitbcf763d41776705ad62972e766d73fd9533bbb9e (patch)
tree55e146eed65d0666a9fb1b3d47da49ed4c61df3a /terminal.c
parentselection: only left button can be used for selection (diff)
selection: add a selection API
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 5b4b0f50..d6d75641 100644
--- a/terminal.c
+++ b/terminal.c
@@ -15,10 +15,25 @@
#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