aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-06-27 18:16:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-06-27 18:16:39 +0000
commitdeb61d20d82bdfc45af2aa51786fa500e53b84bb (patch)
tree95ec81f20848f88e923399c92c216440f5103507
parentterminfo: add remaining keypad keys (diff)
grid: reflow: delete sixels that end up crossing the scrollback wrap around
Our sixel handling code requires sixels to *not* cross the scrollback wrap around. Until we've fixes the reflow code that split up such sixels (much like we do when we generate a sixel), simply delete it.
-rw-r--r--grid.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/grid.c b/grid.c
index ee10f38b..d1d625c6 100644
--- a/grid.c
+++ b/grid.c
@@ -123,11 +123,12 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols,
struct sixel six = it->item;
six.pos.row = new_row_idx;
- /* TODO: ensure sixels don't span across the wrap-around */
- int end __attribute__((unused)) = (six.pos.row + six.rows - 1) & (new_rows - 1);
- assert(end >= six.pos.row);
-
- tll_push_back(new_sixels, six);
+ int end = (six.pos.row + six.rows - 1) & (new_rows - 1);
+ if (end < six.pos.row) {
+ /* TODO: split sixel instead of removing it... */
+ sixel_destroy(&it->item);
+ } else
+ tll_push_back(new_sixels, six);
tll_remove(grid->sixel_images, it);
}
}