]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper--ivy): Update signature
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 23 Feb 2016 09:41:28 +0000 (10:41 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 23 Feb 2016 09:41:28 +0000 (10:41 +0100)
Now takes a list of candidates, produced by something like
`swiper--candidates'.
This means that a user can call `swiper--ivy' with a filter applied on
`swiper--candidates' to obtain narrowing.

swiper.el

index 923b647f20650720828796962a520c64298a52fc..2d46f08d2b2ddf01968cbfd263295f8c8c90e499 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -310,7 +310,7 @@ numbers; replaces calculating the width from buffer line count."
   "`isearch' with an overview.
 When non-nil, INITIAL-INPUT is the initial search pattern."
   (interactive)
-  (swiper--ivy initial-input))
+  (swiper--ivy (swiper--candidates) initial-input))
 
 (declare-function string-trim-right "subr-x")
 
@@ -385,15 +385,14 @@ line numbers. For the buffer, use `ivy--regex' instead."
 (defvar swiper-invocation-face nil
   "The face at the point of invocation of `swiper'.")
 
-(defun swiper--ivy (&optional initial-input)
-  "`isearch' with an overview using `ivy'.
+(defun swiper--ivy (candidates &optional initial-input)
+  "Select one of CANDIDATES and move there.
 When non-nil, INITIAL-INPUT is the initial search pattern."
   (interactive)
   (swiper--init)
   (setq swiper-invocation-face
         (plist-get (text-properties-at (point)) 'face))
-  (let ((candidates (swiper--candidates))
-        (preselect
+  (let ((preselect
          (if swiper-use-visual-line
              (count-screen-lines
               (point-min)