aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sixel.c b/sixel.c
index 898b8713..89acd638 100644
--- a/sixel.c
+++ b/sixel.c
@@ -741,9 +741,20 @@ sixel_unhook(struct terminal *term)
image.width, image.height,
img_data, stride);
- /* Allocate space *first*, then insert */
- for (size_t i = 0; i < image.rows; i++)
+ /* Allocate space *first* (by emitting line-feeds), then insert */
+ for (size_t i = 0; i < image.rows; i++) {
+ struct row *row = term->grid->cur_row;
+ row->dirty = true;
+
+ /* Mark cells touched by the sixel as dirty */
+ for (int col = image.pos.col;
+ col < min(image.pos.col + image.cols, term->cols);
+ col++)
+ {
+ row->cells[col].attrs.clean = 0;
+ }
term_linefeed(term);
+ }
term_carriage_return(term);
_sixel_overwrite_by_rectangle(