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

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

[elpa] externals/embark 3579f1f 09/10: Add minibuffer indicators for Ver


From: ELPA Syncer
Subject: [elpa] externals/embark 3579f1f 09/10: Add minibuffer indicators for Vertico and Selectrum (Fix #427)
Date: Sat, 11 Dec 2021 19:57:19 -0500 (EST)

branch: externals/embark
commit 3579f1fd0d85428dd075bb8af6a61a576a9266e7
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add minibuffer indicators for Vertico and Selectrum (Fix #427)
---
 embark.el | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/embark.el b/embark.el
index 66f6d2c..e72c588 100644
--- a/embark.el
+++ b/embark.el
@@ -3127,7 +3127,18 @@ Return the category metadatum as the type of the 
candidates."
     (cons (completion-metadata-get (embark--metadata) 'category)
           vertico--candidates)))
 
+(defun embark--vertico-indicator ()
+  "Embark indicator highlighting the current Vertico candidate."
+  (let ((fr face-remapping-alist))
+    (lambda (&optional keymap _targets _prefix)
+      (when vertico--input
+        (setq-local face-remapping-alist
+                    (if keymap
+                        (cons '(vertico-current . embark-target) fr)
+                      fr))))))
+
 (with-eval-after-load 'vertico
+  (add-hook 'embark-indicators #'embark--vertico-indicator)
   (add-hook 'embark-target-finders #'embark--vertico-selected)
   (add-hook 'embark-candidate-collectors #'embark--vertico-candidates))
 
@@ -3162,7 +3173,18 @@ Return the category metadatum as the type of the 
candidates."
           ;; Pass relative file names for dired.
           minibuffer-completing-file-name))))
 
+(defun embark--selectrum-indicator ()
+  "Embark indicator highlighting the current Selectrum candidate."
+  (let ((fr face-remapping-alist))
+    (lambda (&optional keymap _targets _prefix)
+      (when selectrum-is-active
+        (setq-local face-remapping-alist
+                    (if keymap
+                        (cons '(selectrum-current-candidate . embark-target) 
fr)
+                      fr))))))
+
 (with-eval-after-load 'selectrum
+  (add-hook 'embark-indicators #'embark--selectrum-indicator)
   (add-hook 'embark-target-finders #'embark--selectrum-selected)
   (add-hook 'embark-candidate-collectors #'embark--selectrum-candidates))
 



reply via email to

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