emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master e04b10c 248/399: swiper.el (swiper-isearch-function): Refa


From: Oleh Krehel
Subject: [elpa] master e04b10c 248/399: swiper.el (swiper-isearch-function): Refactor
Date: Sat, 20 Jul 2019 14:57:33 -0400 (EDT)

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

    swiper.el (swiper-isearch-function): Refactor
---
 swiper.el | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/swiper.el b/swiper.el
index 106723a..4cc9bc3 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1234,18 +1234,18 @@ come back to the same place as when \"a\" was initially 
entered.")
 
 (defun swiper-isearch-function (str)
   "Collect STR matches in the current buffer for `swiper-isearch'."
-  (let* ((case-fold-search (ivy--case-fold-p str))
-         (re-full (funcall ivy--regex-function str))
-         (re (ivy-re-to-str re-full)))
-    (unless (string= re "")
-      (let ((re (if (string-match "\\`\\(.*\\)[\\]|\\'" re)
-                    (match-string 1 re)
-                  re))
-            (pt-hist (cdr (assoc str swiper--isearch-point-history)))
-            cands
-            idx-found
-            (idx 0))
-        (with-ivy-window
+  (with-ivy-window
+    (let* ((case-fold-search (ivy--case-fold-p str))
+           (re-full (funcall ivy--regex-function str))
+           (re (ivy-re-to-str re-full)))
+      (unless (string= re "")
+        (let ((re (if (string-match "\\`\\(.*\\)[\\]|\\'" re)
+                      (match-string 1 re)
+                    re))
+              (pt-hist (cdr (assoc str swiper--isearch-point-history)))
+              cands
+              idx-found
+              (idx 0))
           (save-excursion
             (goto-char (point-min))
             (while (re-search-forward re nil t)
@@ -1263,11 +1263,11 @@ come back to the same place as when \"a\" was initially 
entered.")
                              (match-beginning 0)
                            (point))))
                 (put-text-property 0 1 'point pos line)
-                (push line cands)))))
-        (setq ivy--old-re re)
-        (when idx-found
-          (ivy-set-index idx-found))
-        (setq ivy--old-cands (nreverse cands))))))
+                (push line cands))))
+          (setq ivy--old-re re)
+          (when idx-found
+            (ivy-set-index idx-found))
+          (setq ivy--old-cands (nreverse cands)))))))
 
 (defun swiper-isearch-action (x)
   "Move to X for `swiper-isearch'."



reply via email to

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