selection: handle line break at last column correctly

Insert a newline into the selection even if the last column contained
a printable character, *if* that column also has linefeed=1.
This commit is contained in:
Daniel Eklöf 2020-02-11 19:36:31 +01:00
parent e56523f326
commit b28a742a00
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -212,7 +212,8 @@ extract_one(struct terminal *term, struct row *row, struct cell *cell,
struct extract *ctx = data;
if (ctx->last_row != NULL && row != ctx->last_row &&
((term->selection.kind == SELECTION_NORMAL && ctx->last_cell->wc == 0) ||
((term->selection.kind == SELECTION_NORMAL &&
(ctx->last_cell->wc == 0 || ctx->last_cell->attrs.linefeed)) ||
term->selection.kind == SELECTION_BLOCK))
{
/* Last cell was the last column in the selection */