term: add term_reset_view() - make view follow end-of-output again

This commit is contained in:
Daniel Eklöf 2019-08-28 17:25:42 +02:00
parent 6fa1734468
commit 777863ac3e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 12 additions and 0 deletions

View file

@ -362,6 +362,16 @@ term_reverse_index(struct terminal *term)
term_cursor_up(term, 1);
}
void
term_reset_view(struct terminal *term)
{
if (term->grid->view == term->grid->offset)
return;
term->grid->view = term->grid->offset;
term_damage_view(term);
}
void
term_restore_cursor(struct terminal *term)
{

View file

@ -392,6 +392,8 @@ 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_reset_view(struct terminal *term);
void term_damage_scroll(
struct terminal *term, enum damage_type damage_type,
struct scroll_region region, int lines);