sixel: unhook: do overwrite *after* linefeeding

This ensures the overwrite is done when the scrollback history is in
the same state as when we then insert the new image.
This commit is contained in:
Daniel Eklöf 2020-10-05 18:32:44 +02:00
parent 0e4b0fefc1
commit d54adc5263
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -706,8 +706,8 @@ sixel_unhook(struct terminal *term)
.pos = (struct coord){start_col, cur_row},
};
sixel_overwrite_by_rectangle(
term, cursor->row, image.pos.col, image.rows, image.cols);
assert(image.rows < term->grid->num_rows);
assert(image.pos.row + image.rows - 1 < term->grid->num_rows);
LOG_DBG("generating %dx%d pixman image at %d-%d",
image.width, image.height,
@ -723,6 +723,9 @@ sixel_unhook(struct terminal *term)
term_linefeed(term);
term_carriage_return(term);
_sixel_overwrite_by_rectangle(
term, image.pos.row, image.pos.col, image.rows, image.cols);
sixel_insert(term, image);
pixel_row_idx += height;