branch: externals/vertico
commit f4bde3a1fb84b5df464093aeb8b3c1b226ab5b9f
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Ensure that orderless highlighting succeeds
---
 minicomp.el | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 0bd51eb..c7f9425 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -476,14 +476,18 @@
     (setq-local orderless-skip-highlighting t
                 minicomp--highlight-function
                 (lambda (input metadata candidates)
-                  (let ((orderless-skip-highlighting nil))
-                    (nconc
-                     (completion-all-completions input
-                                                 candidates
-                                                 nil
-                                                 (length input)
-                                                 metadata)
-                     nil)))))
+                  ;; Pass once again through the completion style for 
highlighting
+                  (let* ((orderless-skip-highlighting nil)
+                         (highlighted (nconc
+                                       (completion-all-completions input
+                                                                   candidates
+                                                                   nil
+                                                                   (length 
input)
+                                                                   metadata)
+                                       nil)))
+                    ;; Check if everything went alright, all the candidates 
should still be present.
+                    (if (= (length highlighted) (length candidates))
+                        highlighted candidates)))))
   (use-local-map minicomp-map)
   (add-hook 'post-command-hook #'minicomp--exhibit -99 'local))
 

Reply via email to