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

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

[elpa] externals/vertico 6731bd29b9 2/2: vertico--display-string: Displa


From: ELPA Syncer
Subject: [elpa] externals/vertico 6731bd29b9 2/2: vertico--display-string: Display properties should inherit face
Date: Sun, 7 May 2023 05:58:45 -0400 (EDT)

branch: externals/vertico
commit 6731bd29b9dfe69171435d9bbaeb2201ffcde079
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    vertico--display-string: Display properties should inherit face
---
 vertico.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/vertico.el b/vertico.el
index 647b57c8a2..fe5c6acbfe 100644
--- a/vertico.el
+++ b/vertico.el
@@ -452,14 +452,17 @@ The function is configured by BY, BSIZE, BINDEX, BPRED 
and PRED."
   (let ((end (length str)) (pos 0) chunks)
     (while (< pos end)
       (let ((nextd (next-single-property-change pos 'display str end))
-            (display (get-text-property pos 'display str)))
-        (if (stringp display)
-            (progn (push display chunks) (setq pos nextd))
+            (disp (get-text-property pos 'display str)))
+        (if (stringp disp)
+            (let ((face (get-text-property pos 'face str)))
+              (when face
+                (add-face-text-property 0 (length disp) face t (setq disp 
(concat disp))))
+              (setq pos nextd chunks (cons disp chunks)))
           (while (< pos nextd)
             (let ((nexti (next-single-property-change pos 'invisible str 
nextd)))
-              (unless (get-text-property pos 'invisible str)
-                (unless (and (= pos 0) (= nexti end)) ;; full string -> avoid 
allocation
-                  (push (substring str pos nexti) chunks)))
+              (unless (or (get-text-property pos 'invisible str)
+                          (and (= pos 0) (= nexti end))) ;; full string -> no 
allocation
+                  (push (substring str pos nexti) chunks))
               (setq pos nexti))))))
     (if chunks (apply #'concat (nreverse chunks)) str)))
 



reply via email to

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