mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term: add term_damage_cursor() and term_damage_margins()
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.
This commit is contained in:
parent
be9736dea3
commit
5116e40581
2 changed files with 18 additions and 0 deletions
13
terminal.c
13
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)
|
||||
|
|
|
|||
|
|
@ -388,6 +388,8 @@ struct terminal {
|
|||
bool title;
|
||||
} pending;
|
||||
|
||||
bool margins; /* Someone explicitly requested a refresh of the margins */
|
||||
|
||||
int scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */
|
||||
|
||||
struct {
|
||||
|
|
@ -512,6 +514,9 @@ void term_damage_rows_in_view(struct terminal *term, int start, int end);
|
|||
void term_damage_all(struct terminal *term);
|
||||
void term_damage_view(struct terminal *term);
|
||||
|
||||
void term_damage_cursor(struct terminal *term);
|
||||
void term_damage_margins(struct terminal *term);
|
||||
|
||||
void term_reset_view(struct terminal *term);
|
||||
|
||||
void term_damage_scroll(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue