diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-16 10:26:45 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-23 09:43:59 +0000 |
| commit | 07f6b3b1af2ad9a492efe81c867cd033ae22f12a (patch) | |
| tree | 7866b1d08e3401c1a61c1b03d7616d5444fd38f5 /selection.c | |
| parent | config: add new option ‘selection-target’ (diff) | |
selection: copy selected text to the target configured by ‘selection-target’
Closes #288
Diffstat (limited to 'selection.c')
| -rw-r--r-- | selection.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/selection.c b/selection.c index 966b6b2a..0c4c6d1b 100644 --- a/selection.c +++ b/selection.c @@ -1017,7 +1017,20 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial) } xassert(term->selection.start.row <= term->selection.end.row); - selection_to_primary(seat, term, serial); + + switch (term->conf->selection_target) { + case SELECTION_TARGET_PRIMARY: + selection_to_primary(seat, term, serial); + break; + case SELECTION_TARGET_CLIPBOARD: + selection_to_clipboard(seat, term, serial); + break; + + case SELECTION_TARGET_BOTH: + selection_to_primary(seat, term, serial); + selection_to_clipboard(seat, term, serial); + break; + } } void |
