Fix Kitty image deletion, placeholders and placement geometry.

This commit is contained in:
Michael Grant
2026-10-09 10:44:11 +02:00
parent cd14c5fc1a
commit a0d5763515
12 changed files with 939 additions and 380 deletions

18
tty.c
View File

@@ -1935,6 +1935,22 @@ tty_cmd_alignmenttest(struct tty *tty, const struct tty_ctx *ctx)
void
tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
{
const struct grid_cell *cell = ctx->cell;
#ifdef ENABLE_IMAGES
struct grid_cell placeholder_cell;
struct kitty_placeholder placeholder;
if (kitty_cell_is_placeholder(cell)) {
if (image_grid_get_placeholder(ctx->s->grid, ctx->ocx,
ctx->s->grid->hsize + ctx->ocy, &placeholder)) {
memcpy(&placeholder_cell, cell,
sizeof placeholder_cell);
utf8_set(&placeholder_cell.data, ' ');
cell = &placeholder_cell;
}
}
#endif
if (!tty_is_visible(tty, ctx, ctx->ocx, ctx->ocy, 1, 1))
return;
@@ -1948,7 +1964,7 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
tty_invalidate(tty);
tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy);
tty_cell(tty, ctx->cell, &ctx->style_ctx);
tty_cell(tty, cell, &ctx->style_ctx);
if (ctx->flags & TTY_CTX_CELL_INVALIDATE)
tty_invalidate(tty);