From 3a9172342fd69c09d3fddfb26eba12dcbe1e5149 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 6 Jan 2021 10:53:27 +0100 Subject: selection: combine enum selection_kind with selection_semantic --- extract.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'extract.c') diff --git a/extract.c b/extract.c index a6492716..f9470871 100644 --- a/extract.c +++ b/extract.c @@ -119,9 +119,7 @@ extract_one(const struct terminal *term, const struct row *row, if (ctx->last_row != NULL && row != ctx->last_row) { /* New row - determine if we should insert a newline or not */ - if (ctx->selection_kind == SELECTION_NONE || - ctx->selection_kind == SELECTION_NORMAL) - { + if (ctx->selection_kind != SELECTION_BLOCK) { if (ctx->last_row->linebreak || ctx->empty_count > 0 || cell->wc == 0) @@ -134,9 +132,7 @@ extract_one(const struct terminal *term, const struct row *row, ctx->newline_count++; ctx->empty_count = 0; } - } - - else if (ctx->selection_kind == SELECTION_BLOCK) { + } else { /* Always insert a linebreak */ if (!ensure_size(ctx, 1)) goto err; -- cgit v1.3