mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-04 06:46:48 -04:00
selection: trim trailing spaces from block selections
The extract_*() family of functions can now optionally treat spaces as empty cells. Use this in selection_to_text() to trim trailing spaces from block selections. Closes #181
This commit is contained in:
parent
c9de30e2bc
commit
194cf1ce87
5 changed files with 13 additions and 5 deletions
|
|
@ -224,7 +224,10 @@ selection_to_text(const struct terminal *term)
|
|||
if (term->selection.end.row == -1)
|
||||
return NULL;
|
||||
|
||||
struct extraction_context *ctx = extract_begin(term->selection.kind);
|
||||
const enum selection_kind kind = term->selection.kind;
|
||||
const bool trim_trailing_spaces = kind == SELECTION_BLOCK;
|
||||
|
||||
struct extraction_context *ctx = extract_begin(kind, trim_trailing_spaces);
|
||||
if (ctx == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue