branch: master
commit 45035aa27e6bb2fea6dee90c9065efc0c2c57e06
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>
* xclip.el (xclip-get-selection): Tell wl-paste not to add a newline
Suggested by Nolan Wright <[email protected]>.
---
packages/xclip/xclip.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el
index 1713bf7..ead5111 100644
--- a/packages/xclip/xclip.el
+++ b/packages/xclip/xclip.el
@@ -185,7 +185,12 @@ See also `x-set-selection'."
(replace-regexp-in-string "\\(.*\\)copy" "\\1paste"
xclip-program 'fixedcase)
nil standard-output nil
- (if (memq type '(primary PRIMARY)) '("-p")))))
+ ;; From wl-paste's doc:
+ ;; -n, --no-newline Do not append a newline character
+ ;; after the pasted clipboard content. This option is
+ ;; automatically enabled for non-text content types and
+ ;; when using the --watch mode.
+ "-n" (if (memq type '(primary PRIMARY)) '("-p")))))
(`termux-clipboard-get
(when (memq type '(clipboard CLIPBOARD))
(call-process xclip-program nil standard-output nil)))