mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
selection: foreach: don't call callback for trailing multi-character cells
This commit is contained in:
parent
7d134e6b1c
commit
3bc404b5a3
1 changed files with 6 additions and 1 deletions
|
|
@ -135,6 +135,8 @@ foreach_selected_normal(
|
|||
c++)
|
||||
{
|
||||
cb(term, row, &row->cells[c], c, data);
|
||||
c += max(1, wcwidth(row->cells[c].wc)) - 1;
|
||||
assert(c < term->cols);
|
||||
}
|
||||
|
||||
start_col = 0;
|
||||
|
|
@ -165,8 +167,11 @@ foreach_selected_block(
|
|||
struct row *row = term->grid->rows[real_r];
|
||||
assert(row != NULL);
|
||||
|
||||
for (int c = top_left.col; c <= bottom_right.col; c++)
|
||||
for (int c = top_left.col; c <= bottom_right.col; c++) {
|
||||
cb(term, row, &row->cells[c], c, data);
|
||||
c += max(1, wcwidth(row->cells[c].wc)) - 1;
|
||||
assert(c < term->cols);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue