]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix the issue caused by recursive swiper calls
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 27 Nov 2015 22:21:40 +0000 (23:21 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 27 Nov 2015 22:21:40 +0000 (23:21 +0100)
* swiper.el (swiper--ivy): Look at the return result of `ivy-read';
looking at `ivy-exit' no longer works.

Fixes #311

swiper.el

index a744de98207efa00e112a86cc80c80bf975d9801..45492a18ea85eff87e349ffa2139cbfcd6b6e338 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -353,22 +353,24 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
               (point-min)
               (save-excursion (beginning-of-visual-line) (point)))
            (1- (line-number-at-pos))))
-        (minibuffer-allow-text-properties t))
+        (minibuffer-allow-text-properties t)
+        res)
     (unwind-protect
-         (ivy-read
-          "Swiper: "
-          candidates
-          :initial-input initial-input
-          :keymap swiper-map
-          :preselect preselect
-          :require-match t
-          :update-fn #'swiper--update-input-ivy
-          :unwind #'swiper--cleanup
-          :action #'swiper--action
-          :re-builder #'swiper--re-builder
-          :history 'swiper-history
-          :caller 'swiper)
-      (when (null ivy-exit)
+         (setq res
+               (ivy-read
+                "Swiper: "
+                candidates
+                :initial-input initial-input
+                :keymap swiper-map
+                :preselect preselect
+                :require-match t
+                :update-fn #'swiper--update-input-ivy
+                :unwind #'swiper--cleanup
+                :action #'swiper--action
+                :re-builder #'swiper--re-builder
+                :history 'swiper-history
+                :caller 'swiper))
+      (unless res
         (goto-char swiper--opoint)))))
 
 (defun swiper-toggle-face-matching ()