From bead6f36d6c5793baa1dd307c6a4e6fbeda46586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 15 Jul 2020 09:22:06 +0200 Subject: [PATCH] selection: don't skip SPACER cells in the generic foreach() As that breaks e.g. selection marking (SPACER cells didn't get inverted when rendered). Instead, skip them in extract_one() only. I.e. when copying text from the grid. --- selection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/selection.c b/selection.c index 7b94a359..165b7c46 100644 --- a/selection.c +++ b/selection.c @@ -134,8 +134,6 @@ 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); } @@ -168,8 +166,6 @@ 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); } } @@ -269,6 +265,9 @@ extract_one(struct terminal *term, struct row *row, struct cell *cell, { struct extract *ctx = data; + if (cell->wc == CELL_MULT_COL_SPACER) + return; + if (ctx->last_row != NULL && row != ctx->last_row) { /* New row - determine if we should insert a newline or not */