From ce8005545d5bc94775f616d0caacd55e691e400f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 14 Feb 2020 22:39:26 +0100 Subject: term: convert cell 'linefeed' attribute to a row 'linebreak' property To do text reflow, we only need to know if a line has been explicitly linebreaked or not. If not, that means it wrapped, and that we should *not* insert a linebreak when reflowing text. When reflowing text, when reaching the end of a row in the old grid, only insert a linebreak in the new grid if the old row had been explicitly linebreaked. Furthermore, when reflowing text and wrapping a row in the new grid, mark the previous row as linebreaked if either the last cell was (the last column in the last row) empty, or the current cell (the first column in the new row) is empty. If both are non-empty, then we assume a linewrap. --- selection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'selection.c') diff --git a/selection.c b/selection.c index f1485f45..189119d9 100644 --- a/selection.c +++ b/selection.c @@ -213,7 +213,7 @@ extract_one(struct terminal *term, struct row *row, struct cell *cell, if (ctx->last_row != NULL && row != ctx->last_row && ((term->selection.kind == SELECTION_NORMAL && - (ctx->last_cell->wc == 0 || ctx->last_cell->attrs.linefeed)) || + ctx->last_row->linebreak) || term->selection.kind == SELECTION_BLOCK)) { /* Last cell was the last column in the selection */ -- cgit v1.3