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

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

[elpa] master 0134255 281/399: ivy.el (ivy--highlight-default): Use sing


From: Oleh Krehel
Subject: [elpa] master 0134255 281/399: ivy.el (ivy--highlight-default): Use single face for adjacent groups
Date: Sat, 20 Jul 2019 14:57:40 -0400 (EDT)

branch: master
commit 013425558d23357e2085d96d1cc8a5f9266d342f
Author: Andrew Whatson <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--highlight-default): Use single face for adjacent groups
    
    This improves highlighting for fuzzy matches by using a single face for
    adjacent groups.
    
    Fixes #2080
---
 ivy.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index c4a8384..be0a194 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3551,19 +3551,25 @@ Note: The usual last two arguments are flipped for 
convenience.")
         (while (and (string-match re str start)
                     (> (- (match-end 0) (match-beginning 0)) 0))
           (setq start (match-end 0))
-          (let ((i 0))
+          (let ((i 0)
+                (n 0)
+                prev)
             (while (<= i ivy--subexps)
               (let ((beg (match-beginning i))
                     (end (match-end i)))
                 (when (and beg end)
+                  (unless (and prev (= prev beg))
+                    (cl-incf n))
                   (let ((face
                          (cond ((zerop ivy--subexps)
                                 (cadr ivy-minibuffer-faces))
                                ((zerop i)
                                 (car ivy-minibuffer-faces))
                                (t
-                                (ivy--minibuffer-face i)))))
-                    (ivy-add-face-text-property beg end face str))))
+                                (ivy--minibuffer-face n)))))
+                    (ivy-add-face-text-property beg end face str))
+                  (unless (zerop i)
+                    (setq prev end))))
               (cl-incf i)))))))
   str)
 



reply via email to

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