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.
This commit is contained in:
Daniel Eklöf 2020-07-15 09:22:06 +02:00
parent 540864521e
commit bead6f36d6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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 */