mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
selection: update: simplify: multi-column chars don’t span line-wraps
This commit is contained in:
parent
2b195d2cc3
commit
fb9a95494d
1 changed files with 8 additions and 14 deletions
22
selection.c
22
selection.c
|
|
@ -620,13 +620,11 @@ selection_update(struct terminal *term, int col, int row)
|
||||||
|
|
||||||
keep_going = wc == CELL_MULT_COL_SPACER;
|
keep_going = wc == CELL_MULT_COL_SPACER;
|
||||||
|
|
||||||
if (pivot_end->col == 0) {
|
/* Multi-col chars shouldn’t span line-wraps */
|
||||||
if (pivot_end->row > 0) {
|
assert(pivot_end->col > 0);
|
||||||
pivot_end->col = term->cols - 1;
|
if (pivot_end->col == 0)
|
||||||
pivot_end->row--;
|
break;
|
||||||
}
|
pivot_end->col--;
|
||||||
} else
|
|
||||||
pivot_end->col--;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool keep_going = true;
|
bool keep_going = true;
|
||||||
|
|
@ -637,13 +635,9 @@ selection_update(struct terminal *term, int col, int row)
|
||||||
|
|
||||||
keep_going = wc == CELL_MULT_COL_SPACER;
|
keep_going = wc == CELL_MULT_COL_SPACER;
|
||||||
|
|
||||||
if (pivot_start->col >= term->cols - 1) {
|
if (pivot_start->col >= term->cols - 1)
|
||||||
if (pivot_start->row < term->rows - 1) {
|
break;
|
||||||
pivot_start->col = 0;
|
pivot_start->col++;
|
||||||
pivot_start->row++;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
pivot_start->col++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue