From b28a742a0032bbd54c6429257e06d453b131e0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 11 Feb 2020 19:36:31 +0100 Subject: [PATCH] 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. --- selection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selection.c b/selection.c index 2c7bc0b2..f1485f45 100644 --- a/selection.c +++ b/selection.c @@ -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 */