branch: externals/consult
commit 29ce1ba14b578ebf28f00143e0b6280ad037029e
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Simplify and add comment
---
 consult.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/consult.el b/consult.el
index d235423f6c..a71e5fd052 100644
--- a/consult.el
+++ b/consult.el
@@ -2136,12 +2136,12 @@ INHERIT-INPUT-METHOD, if non-nil the minibuffer 
inherits the input method."
         (dolist (item items)
           (let ((cand (consult--tofu-append item idx))
                 (width (consult--display-width item)))
-            (add-text-properties 0 (length item)
-                                 `(multi-category
-                                   ,(or (get-text-property 0 'multi-category 
item)
-                                        (cons cat item))
-                                   ,@face)
-                                 cand)
+            ;; Preserve existing `multi-category' datum of the candidate.
+            (if (get-text-property 0 'multi-category cand)
+                (when face (add-text-properties 0 (length item) face cand))
+              ;; Attach `multi-category' datum and face.
+              (add-text-properties 0 (length item)
+                                   `(multi-category (,cat . ,item) ,@face) 
cand))
             (when (> width max-width) (setq max-width width))
             (push cand candidates))))
       (setq idx (1+ idx)))

Reply via email to