aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 14:49:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 14:49:11 +0000
commitdf2927e088ceb2119264d1a970c22a450f00005b (patch)
treef902d442373f54b7f69aa9e0d6d62175427ade34 /selection.c
parentterm: rename COMB_CHARS_LO,HI -> CELL_COMB_CHARS_LO,HI (diff)
term: print: write special value CELL_MULT_COL_SPACER to extra cells
When printing a multi-column character, write CELL_MULT_COL_SPACER instead of '0' to both padding cells (when character doesn't fit at the end of the line), and to the cells following the actual character.
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/selection.c b/selection.c
index 8dc83906..d5f8721c 100644
--- a/selection.c
+++ b/selection.c
@@ -134,9 +134,9 @@ foreach_selected_normal(
c <= (r == end_row ? end_col : term->cols - 1);
c++)
{
+ if (row->cells[c].wc == CELL_MULT_COL_SPACER)
+ continue;
cb(term, row, &row->cells[c], c, data);
- c += max(1, wcwidth(row->cells[c].wc)) - 1;
- assert(c < term->cols);
}
start_col = 0;
@@ -168,9 +168,9 @@ foreach_selected_block(
assert(row != NULL);
for (int c = top_left.col; c <= bottom_right.col; c++) {
+ if (row->cells[c].wc == CELL_MULT_COL_SPACER)
+ continue;
cb(term, row, &row->cells[c], c, data);
- c += max(1, wcwidth(row->cells[c].wc)) - 1;
- assert(c < term->cols);
}
}
}