grid: move 'cursor' state from terminal to grid

This way, the 'normal' and 'alt' grids have their own cursor state,
and we don't need to switch between them.
This commit is contained in:
Daniel Eklöf 2020-04-16 18:51:14 +02:00
parent c96a0b3b3c
commit 89559d5466
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 136 additions and 129 deletions

View file

@ -125,7 +125,7 @@ sixel_delete_in_range(struct terminal *term, int _start, int _end)
void
sixel_delete_at_cursor(struct terminal *term)
{
sixel_delete_at_row(term, term->cursor.point.row);
sixel_delete_at_row(term, term->grid->cursor.point.row);
}
void
@ -142,8 +142,8 @@ sixel_unhook(struct terminal *term)
.height = term->sixel.image.height,
.rows = (term->sixel.image.height + term->cell_height - 1) / term->cell_height,
.pos = (struct coord){
term->cursor.point.col,
(term->grid->offset + term->cursor.point.row) & (term->grid->num_rows - 1)},
term->grid->cursor.point.col,
(term->grid->offset + term->grid->cursor.point.row) & (term->grid->num_rows - 1)},
};
LOG_DBG("generating %dx%d pixman image", image.width, image.height);