diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-05-02 15:29:00 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-05-02 15:29:00 +0000 |
| commit | d945b68b734427a03d114716ff8aeac7998a7c57 (patch) | |
| tree | 93c73c5ab615ccf66244713d15a2a7a2fd139e0d /selection.c | |
| parent | unicode-combining: don't limit ourselves to the (western) diacritics blocks (diff) | |
unicode-combine: remove utf8proc dependency
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.
We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.
That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
Diffstat (limited to 'selection.c')
| -rw-r--r-- | selection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/selection.c b/selection.c index f9f7f6cd..2fa1c50a 100644 --- a/selection.c +++ b/selection.c @@ -143,7 +143,7 @@ min_bufsize_for_extraction(const struct terminal *term) const struct coord *start = &term->selection.start; const struct coord *end = &term->selection.end; const size_t chars_per_cell = -#if FOOT_UNICODE_COMBINING +#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0 1 + ALEN(term->grid->cur_row->comb_chars[0].chars); #else 1; @@ -241,7 +241,7 @@ extract_one(struct terminal *term, struct row *row, struct cell *cell, assert(ctx->idx + 1 <= ctx->size); ctx->buf[ctx->idx++] = cell->wc; -#if FOOT_UNICODE_COMBINING +#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0 const struct combining_chars *comb_chars = &row->comb_chars[col]; assert(cell->wc != 0); |
