[Top][All Lists]

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

[elpa] master 56f6590 054/110: avy.el (avy-action-copy): Adjust for avy-

From: Oleh Krehel
Subject: [elpa] master 56f6590 054/110: avy.el (avy-action-copy): Adjust for avy-goto-line
Date: Sat, 11 May 2019 10:15:42 -0400 (EDT)

branch: master
commit 56f6590c206d3cd42246520dabd600aad1aa9539
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy-action-copy): Adjust for avy-goto-line
    Re #191
 avy.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/avy.el b/avy.el
index 8c3f6b2..dbacdca 100644
--- a/avy.el
+++ b/avy.el
@@ -627,20 +627,24 @@ Set `avy-style' according to COMMMAND as well."
     (raise-frame frame)
     (goto-char pt)))
+(defun avy-forward-item ()
+  (if (eq avy-command 'avy-goto-line)
+      (end-of-line)
+    (forward-sexp))
+  (point))
 (defun avy-action-mark (pt)
   "Mark sexp at PT."
   (goto-char pt)
   (set-mark (point))
-  (forward-sexp))
+  (avy-forward-item))
 (defun avy-action-copy (pt)
   "Copy sexp starting on PT."
     (let (str)
       (goto-char pt)
-      (if (eq avy-command 'avy-goto-line)
-          (end-of-line)
-        (forward-sexp))
+      (avy-forward-item)
       (setq str (buffer-substring pt (point)))
       (kill-new str)
       (message "Copied: %s" str)))

reply via email to

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