aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-03 09:36:20 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-03 09:36:20 +0000
commit1d1eb899257a98db81d2cd3a634135b60ba0d0ba (patch)
tree14d141ed96f7e47a6adb6102a0ab1626cd125a29 /grid.c
parentosc: fix scaling of RGB formatted color specifiers (diff)
parentunicode-combining: limit maximum number of allowed composed chains (diff)
Merge branch 'space-optimize-combining-chars'
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/grid.c b/grid.c
index 522df101..51d76191 100644
--- a/grid.c
+++ b/grid.c
@@ -34,17 +34,10 @@ grid_row_alloc(int cols, bool initialize)
if (initialize) {
row->cells = calloc(cols, sizeof(row->cells[0]));
-#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0
- row->comb_chars = calloc(cols, sizeof(row->comb_chars[0]));
-#endif
for (size_t c = 0; c < cols; c++)
row->cells[c].attrs.clean = 1;
- } else {
+ } else
row->cells = malloc(cols * sizeof(row->cells[0]));
-#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0
- row->comb_chars = malloc(cols * sizeof(row->comb_chars[0]));
-#endif
- }
return row;
}
@@ -55,9 +48,6 @@ grid_row_free(struct row *row)
if (row == NULL)
return;
-#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0
- free(row->comb_chars);
-#endif
free(row->cells);
free(row);
}
@@ -214,17 +204,6 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols,
new_row->cells[new_col_idx] = *old_cell;
new_row->cells[new_col_idx].attrs.clean = 1;
-#if FOOT_UNICODE_MAX_COMBINING_CHARS > 0
- struct combining_chars *old_comb_chars
- = &old_row->comb_chars[c - empty_count + i];
- struct combining_chars *new_comb_chars
- = &new_row->comb_chars[new_col_idx];
-
- new_comb_chars->count = old_comb_chars->count;
- for (size_t j = 0; j < ALEN(new_comb_chars->chars); j++)
- new_comb_chars->chars[j] = old_comb_chars->chars[j];
-#endif
-
/* Translate tracking point(s) */
if (is_tracking_point && i >= empty_count) {
tll_foreach(tracking_points, it) {