aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-06-20 12:52:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-06-24 05:31:08 +0000
commit5d576fccbaef3e413bcb5b7a98708d2f1904f5d7 (patch)
tree561f75b30e82b915cc83202bf60472baf2a41974 /sixel.c
parentsixel: minor fixes after implementing support for non-1:1 aspect ratios (diff)
sixel: regression: linefeed count for chunked up sixel image
All image chunks but the last *should* scroll the screen content.
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sixel.c b/sixel.c
index a40a54a4..29585d71 100644
--- a/sixel.c
+++ b/sixel.c
@@ -1049,7 +1049,12 @@ sixel_unhook(struct terminal *term)
if (do_scroll) {
/* Yes, truncate last row. This matches XTerm’s, and VT382’s behavior */
- const int linefeed_count = (image.height - 6 * term->sixel.pan + 1) / term->cell_height;
+ const int linefeed_count = rows_avail == 0
+ ? (image.height - 6 * term->sixel.pan + 1) / term->cell_height
+ : image.height / term->cell_height;
+
+ xassert(rows_avail == 0 || image.height % term->cell_height == 0);
+
for (size_t i = 0; i < linefeed_count; i++)
term_linefeed(term);