]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/swiper/swiper.el
Merge commit '5a2e0fd355fea83e3c172402b965a1aa826fcc0c' from swiper
[gnu-emacs-elpa] / packages / swiper / swiper.el
index c58f20fed6ce2ea9739ad50ce97cc5f735d137d4..d15ed80e4060a0313626ae923527e7c66e170567 100644 (file)
 
 (defface swiper-match-face-1
   '((t (:inherit isearch-lazy-highlight-face)))
-  "Face for `swiper' matches.")
+  "The background face for `swiper' matches.")
 
 (defface swiper-match-face-2
   '((t (:inherit isearch)))
-  "Face for `swiper' matches.")
+  "Face for `swiper' matches modulo 1.")
 
 (defface swiper-match-face-3
   '((t (:inherit match)))
-  "Face for `swiper' matches.")
+  "Face for `swiper' matches modulo 2.")
 
 (defface swiper-match-face-4
-  '((t (:inherit isearch)))
-  "Face for `swiper' matches.")
+  '((t (:inherit isearch-fail)))
+  "Face for `swiper' matches modulo 3.")
 
 (defface swiper-line-face
   '((t (:inherit highlight)))
@@ -92,7 +92,7 @@
             (lambda ()
               (with-selected-window swiper--window
                 (perform-replace from to
-                                 t t t))))
+                                 t t nil))))
       (swiper--cleanup)
       (exit-minibuffer))))
 
                                  gnus-group-mode
                                  emms-playlist-mode erc-mode
                                  org-agenda-mode
-                                 dired-mode)))
+                                 dired-mode
+                                 jabber-chat-mode
+                                 elfeed-search-mode)))
     (unless (> (buffer-size) 100000)
       (if (fboundp 'font-lock-ensure)
           (font-lock-ensure)
@@ -172,6 +174,9 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
   "`isearch' with an overview using `ivy'.
 When non-nil, INITIAL-INPUT is the initial search pattern."
   (interactive)
+  (unless (eq (length (help-function-arglist 'ivy-read)) 4)
+    (warn "You seem to be using the outdated stand-alone \"ivy\" package.
+Please remove it and update the \"swiper\" package."))
   (swiper--init)
   (let ((candidates (swiper--candidates))
         (preselect (format
@@ -266,11 +271,11 @@ BEG and END, when specified, are the point bounds."
                                              (match-end i)))
                       (face
                        (cond ((zerop ivy--subexps)
-                              (cl-caddr swiper-faces))
+                              (cadr swiper-faces))
                              ((zerop i)
                               (car swiper-faces))
                              (t
-                              (nth (1+ (mod (1- i) (1- (length swiper-faces))))
+                              (nth (1+ (mod (+ i 2) (1- (length swiper-faces))))
                                    swiper-faces)))))
                   (push overlay swiper--overlays)
                   (overlay-put overlay 'face face)