]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper-query-replace): Don't miss the first
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 16 Jun 2015 07:43:15 +0000 (09:43 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 16 Jun 2015 07:43:15 +0000 (09:43 +0200)
* swiper.el (swiper-query-replace): Since the point is always after the
  matching thing in swiper, it's necessary to move it before it in order
  for `perform-replace' not to skip it.

Fixes #144

swiper.el

index 8312852c0412891a34cbf06cd7ff9421796cf991..c94e8967cc7736ba35c1760dcdb58e36dd87f798 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -97,6 +97,7 @@
       (delete-minibuffer-contents)
       (ivy-set-action (lambda (_)
                         (with-selected-window swiper--window
+                          (move-beginning-of-line 1)
                           (perform-replace from to
                                            t t nil))))
       (swiper--cleanup)