mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-06 04:06:06 -05:00
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:
parent
540864521e
commit
bead6f36d6
1 changed files with 3 additions and 4 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue