mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
selection: no need to try to detect multi-column chars at the end of the line
This is handled by the generic foreach() functions, which now simply skips spacer cells.
This commit is contained in:
parent
9ea42ef226
commit
a2af13a126
1 changed files with 1 additions and 16 deletions
17
selection.c
17
selection.c
|
|
@ -273,22 +273,7 @@ extract_one(struct terminal *term, struct row *row, struct cell *cell,
|
||||||
/* New row - determine if we should insert a newline or not */
|
/* New row - determine if we should insert a newline or not */
|
||||||
|
|
||||||
if (term->selection.kind == SELECTION_NORMAL) {
|
if (term->selection.kind == SELECTION_NORMAL) {
|
||||||
int width = max(1, wcwidth(cell->wc));
|
if (ctx->last_row->linebreak ||
|
||||||
|
|
||||||
if (width > 1) {
|
|
||||||
/* Heuristict to handle force-wrapped multi-column
|
|
||||||
* characters */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* TODO: maybe we should print a placeholder value to
|
|
||||||
* the empty cells at the end of the line when
|
|
||||||
* force-wrapping? Then extract() could simply skip
|
|
||||||
* those cells
|
|
||||||
*/
|
|
||||||
ctx->empty_count -= min(width, ctx->empty_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (ctx->last_row->linebreak ||
|
|
||||||
ctx->empty_count > 0 ||
|
ctx->empty_count > 0 ||
|
||||||
cell->wc == 0)
|
cell->wc == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue