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

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

[elpa] master 89ed4d6 024/272: Improve flx highlighting


From: Oleh Krehel
Subject: [elpa] master 89ed4d6 024/272: Improve flx highlighting
Date: Mon, 25 Apr 2016 10:13:14 +0000

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

    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

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