branch: master
commit 89ed4d6c2f64665c0236df8f9d93217c7be38a94
Author: Oleh Krehel <ohwoeo...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    Improve flx highlighting
    
    * ivy.el (ivy--flx-sort): Highlight continuous characters with same
      face.
---
 ivy.el |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index 2601647..01126d9 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2004,14 +2004,17 @@ Prefix matches to NAME are put ahead of the list."
             (if cands-with-score
                 (mapcar (lambda (x)
                           (let ((str (copy-sequence (cdr x)))
-                                (i 1))
+                                (i 0)
+                                (last-j -2))
                             (dolist (j (cdar x))
+                              (unless (eq j (1+ last-j))
+                                (cl-incf i))
+                              (setq last-j j)
                               (ivy-add-face-text-property
                                j (1+ j)
                                (nth (1+ (mod (+ i 2) (1- (length 
ivy-minibuffer-faces))))
                                     ivy-minibuffer-faces)
-                               str)
-                              (cl-incf i))
+                               str))
                             str))
                         (sort cands-with-score
                               (lambda (x y)

Reply via email to