]> code.delx.au - gnu-emacs-elpa/commitdiff
avy.el (avy-action-goto): Don't push mark when region is active
authorOleh Krehel <ohwoeowho@gmail.com>
Wed, 29 Jul 2015 15:59:42 +0000 (17:59 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Wed, 29 Jul 2015 15:59:42 +0000 (17:59 +0200)
* avy.el (avy-action-goto): When the region is active, the user probably
  doesn't want to move the mark.

Fixes #84

avy.el

diff --git a/avy.el b/avy.el
index b73e372bf3808cd577cfc3e755633aa5555a9542..ae4c59b75a5b1c7827bc533da5a94545386a3a17 100644 (file)
--- a/avy.el
+++ b/avy.el
@@ -452,7 +452,9 @@ Set `avy-style' according to COMMMAND as well."
 
 (defun avy-action-goto (pt)
   "Goto PT."
-  (unless (= pt (point)) (push-mark))
+  (unless (or (= pt (point))
+              (region-active-p))
+    (push-mark))
   (goto-char pt))
 
 (defun avy-action-mark (pt)