config: new option - trim-trailing-spaces-from-selection

When enabled, trailing spaces are trimmed from both regular and block
selections.
This commit is contained in:
Daniel Eklöf 2020-11-11 18:16:49 +01:00
parent 194cf1ce87
commit 20aab0871f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 15 additions and 5 deletions

View file

@ -224,10 +224,9 @@ selection_to_text(const struct terminal *term)
if (term->selection.end.row == -1)
return NULL;
const enum selection_kind kind = term->selection.kind;
const bool trim_trailing_spaces = kind == SELECTION_BLOCK;
struct extraction_context *ctx = extract_begin(
term->selection.kind, term->conf->trim_trailing_spaces_from_selection);
struct extraction_context *ctx = extract_begin(kind, trim_trailing_spaces);
if (ctx == NULL)
return NULL;