From 0caa9c4173b1df677df408435c47a0bc3bde4770 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 29 Sep 2020 10:03:00 +0200 Subject: term: add term_damage_cursor() and term_damage_margins() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit term_damage_cursor() damages the cell where the cursor is currently at. This can be used to ensure the cursor is re-drawn, if there aren’t any other pending updates. term_damage_margins() requests the margins be redrawn the next time we render the grid. --- terminal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 5e0dc65a..0840a45c 100644 --- a/terminal.c +++ b/terminal.c @@ -1626,6 +1626,19 @@ term_damage_view(struct terminal *term) term_damage_rows_in_view(term, 0, term->rows - 1); } +void +term_damage_cursor(struct terminal *term) +{ + term->grid->cur_row->cells[term->grid->cursor.point.col].attrs.clean = 0; + term->grid->cur_row->dirty = true; +} + +void +term_damage_margins(struct terminal *term) +{ + term->render.margins = true; +} + void term_damage_scroll(struct terminal *term, enum damage_type damage_type, struct scroll_region region, int lines) -- cgit v1.3