aboutsummaryrefslogtreecommitdiff
path: root/extract.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-06 09:53:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-06 09:53:27 +0000
commit3a9172342fd69c09d3fddfb26eba12dcbe1e5149 (patch)
tree8fc6ff4bb902a56f9148cfa9fba1c454a2c3f2be /extract.c
parentMerge branch 'extend-selection-by-word' (diff)
selection: combine enum selection_kind with selection_semantic
Diffstat (limited to 'extract.c')
-rw-r--r--extract.c8
1 files changed, 2 insertions, 6 deletions
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;