From 4c6f2ea340d1432e50973961579ebd0eb4ca2c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 24 Feb 2020 18:40:41 +0100 Subject: [PATCH] term: term_erase(): call sixel_delete_*() This ensures sixel images are removed, regardless of _how_ the screen was erased. --- sixel.c | 4 ++-- terminal.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sixel.c b/sixel.c index caa31429..68324fde 100644 --- a/sixel.c +++ b/sixel.c @@ -156,8 +156,6 @@ sixel_unhook(struct terminal *term) term->sixel.image.data, term->sixel.image.width * sizeof(uint32_t)); - tll_push_back(term->sixel_images, image); - term->sixel.image.data = NULL; term->sixel.image.width = 0; term->sixel.image.height = 0; @@ -168,6 +166,8 @@ sixel_unhook(struct terminal *term) term_linefeed(term); term_formfeed(term); render_refresh(term); + + tll_push_back(term->sixel_images, image); } static unsigned diff --git a/terminal.c b/terminal.c index 8504a45b..e73ea15a 100644 --- a/terminal.c +++ b/terminal.c @@ -1366,6 +1366,7 @@ term_erase(struct terminal *term, const struct coord *start, const struct coord if (start->row == end->row) { struct row *row = grid_row(term->grid, start->row); erase_cell_range(term, row, start->col, end->col); + sixel_delete_at_row(term, start->row); return; } @@ -1378,6 +1379,7 @@ term_erase(struct terminal *term, const struct coord *start, const struct coord erase_line(term, grid_row(term->grid, r)); erase_cell_range(term, grid_row(term->grid, end->row), 0, end->col); + sixel_delete_in_range(term, start->row, end->row); } int