aboutsummaryrefslogtreecommitdiff
path: root/extract.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:50:55 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:50:55 +0000
commit80c2d9d89df11c5830de900f98b5d9f3f406a1c1 (patch)
treea27132ebbd0940872c16afd3f48f4ee791820a0a /extract.c
parentMerge branch 'sixel-heap-user-after-free-after-blending' (diff)
parentclient: add +/-graphemes to version output (diff)
Merge branch 'harfbuzz'
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 {