]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper--action): push-mark only if exited the minibuffer
authorOleh Krehel <ohwoeowho@gmail.com>
Sun, 22 Nov 2015 13:00:51 +0000 (14:00 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Sun, 22 Nov 2015 13:01:28 +0000 (14:01 +0100)
"C-M-n" and "C-M-p" will no longer push mark and annoy with messages.

swiper.el

index e1f3d91b37163f1ee9352afc809a06bd9d14d49c..a33f0f35048188e88f7bd28ce588e1f33a9d5e99 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -513,8 +513,9 @@ WND, when specified is the window."
       (swiper--ensure-visible)
       (when (/= (point) swiper--opoint)
         (unless (and transient-mark-mode mark-active)
-          (push-mark swiper--opoint t)
-          (message "Mark saved where search started"))))))
+          (when (eq ivy-exit 'done)
+            (push-mark swiper--opoint t)
+            (message "Mark saved where search started")))))))
 
 ;; (define-key isearch-mode-map (kbd "C-o") 'swiper-from-isearch)
 (defun swiper-from-isearch ()