aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-01 10:05:38 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-01 10:05:38 +0000
commit3474624c2c17058f0fd9f3f1821971e7213d285b (patch)
tree92af8f394e1124952cf69652bdb340376765f730 /selection.c
parentterm: combining characters: reduce max number of combining characters (diff)
unicode-combining: completely remove unicode combining characters when feature is disabled
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/selection.c b/selection.c
index b84f4228..f9f7f6cd 100644
--- a/selection.c
+++ b/selection.c
@@ -142,8 +142,12 @@ 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
- = 1 + ALEN(term->grid->cur_row->comb_chars[0].chars);
+ const size_t chars_per_cell =
+#if FOOT_UNICODE_COMBINING
+ 1 + ALEN(term->grid->cur_row->comb_chars[0].chars);
+#else
+ 1;
+#endif
switch (term->selection.kind) {
case SELECTION_NONE:
@@ -237,12 +241,14 @@ 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
const struct combining_chars *comb_chars = &row->comb_chars[col];
assert(cell->wc != 0);
assert(ctx->idx + comb_chars->count <= ctx->size);
for (size_t i = 0; i < comb_chars->count; i++)
ctx->buf[ctx->idx++] = comb_chars->chars[i];
+#endif
ctx->last_row = row;
ctx->last_cell = cell;