aboutsummaryrefslogtreecommitdiff
path: root/extract.c
diff options
context:
space:
mode:
Diffstat (limited to 'extract.c')
-rw-r--r--extract.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/extract.c b/extract.c
index 07144597..4acd481c 100644
--- a/extract.c
+++ b/extract.c
@@ -223,18 +223,16 @@ extract_one(const struct terminal *term, const struct row *row,
ctx->newline_count = 0;
ctx->empty_count = 0;
- if (cell->wc >= CELL_COMB_CHARS_LO &&
- cell->wc < (CELL_COMB_CHARS_LO + term->composed_count))
+ if (cell->wc >= CELL_COMB_CHARS_LO && cell->wc <= CELL_COMB_CHARS_HI)
{
- const struct composed *composed
- = &term->composed[cell->wc - CELL_COMB_CHARS_LO];
+ const struct composed *composed = composed_lookup(
+ term->composed, cell->wc - CELL_COMB_CHARS_LO);
- if (!ensure_size(ctx, 1 + composed->count))
+ if (!ensure_size(ctx, composed->count))
goto err;
- ctx->buf[ctx->idx++] = composed->base;
for (size_t i = 0; i < composed->count; i++)
- ctx->buf[ctx->idx++] = composed->combining[i];
+ ctx->buf[ctx->idx++] = composed->chars[i];
}
else {