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:
Daniel Eklöf 2020-07-14 17:06:04 +02:00
parent 9ea42ef226
commit a2af13a126
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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 */
if (term->selection.kind == SELECTION_NORMAL) {
int width = max(1, wcwidth(cell->wc));
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 ||
if (ctx->last_row->linebreak ||
ctx->empty_count > 0 ||
cell->wc == 0)
{