From df2927e088ceb2119264d1a970c22a450f00005b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 14 Jul 2020 16:49:11 +0200 Subject: 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. --- selection.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'selection.c') 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); } } } -- cgit v1.3