emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 4645e89 121/184: swiper.el (swiper-action-copy): Add and b


From: Oleh Krehel
Subject: [elpa] master 4645e89 121/184: swiper.el (swiper-action-copy): Add and bind to "M-o w"
Date: Wed, 16 Oct 2019 13:15:03 -0400 (EDT)

branch: master
commit 4645e89fd414f799ea2f8082ede081e33a6000ab
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper-action-copy): Add and bind to "M-o w"
    
    Re #2260
---
 swiper.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/swiper.el b/swiper.el
index af60c5c..11c4bce 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1430,6 +1430,16 @@ that we search only for one character."
            (ivy-state-window ivy-last))))
     (swiper--cleanup)))
 
+(defun swiper-action-copy (_x)
+  "Copy line at point and go back."
+  (kill-new
+   (buffer-substring-no-properties
+    (line-beginning-position) (line-end-position)))
+  (goto-char swiper--opoint))
+
+(ivy-add-actions 'swiper-isearch '(("w" swiper-action-copy "copy")))
+(ivy-add-actions 'swiper '(("w" swiper-action-copy "copy")))
+
 (defun swiper-isearch-thing-at-point ()
   "Insert `symbol-at-point' into the minibuffer of `swiper-isearch'.
 When not running `swiper-isearch' already, start it."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]