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

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

[elpa] externals/vertico f4bde3a 36/48: Ensure that orderless highlighti


From: Stefan Monnier
Subject: [elpa] externals/vertico f4bde3a 36/48: Ensure that orderless highlighting succeeds
Date: Mon, 5 Apr 2021 10:54:45 -0400 (EDT)

branch: externals/vertico
commit f4bde3a1fb84b5df464093aeb8b3c1b226ab5b9f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@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

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