feat(vertico): colorize vertico candidate on act

This commit is contained in:
Itai Y. Efrat 2021-08-10 17:50:00 +03:00
parent c10d277713
commit 26014435b2
2 changed files with 12 additions and 0 deletions

View file

@ -289,3 +289,14 @@ targets."
(default-directory (cdr prompt-dir))) (default-directory (cdr prompt-dir)))
(find-file (consult--find (car prompt-dir) #'+vertico--consult--fd-builder initial))) (find-file (consult--find (car prompt-dir) #'+vertico--consult--fd-builder initial)))
(consult-find dir initial))) (consult-find dir initial)))
;;;###autoload
(defun +vertico-embark-vertico-indicator ()
"An embark indicator that colorizes the vertico candidate differently on act"
(let ((fr face-remapping-alist))
(lambda (&optional keymap _targets prefix)
(when (bound-and-true-p vertico--input)
(setq-local face-remapping-alist
(if keymap
(cons '(vertico-current . embark-target) fr)
fr))))))

View file

@ -147,6 +147,7 @@ overrides `completion-styles' during company completion sessions.")
:config :config
(set-popup-rule! "^\\*Embark Export Grep" :size 0.35 :ttl 0 :quit nil) (set-popup-rule! "^\\*Embark Export Grep" :size 0.35 :ttl 0 :quit nil)
(cl-nsubstitute #'+vertico/embark-which-key-indicator #'embark-mixed-indicator embark-indicators) (cl-nsubstitute #'+vertico/embark-which-key-indicator #'embark-mixed-indicator embark-indicators)
(add-to-list 'embark-indicators #'+vertico-embark-vertico-indicator)
;; add the package! target finder before the file target finder, ;; add the package! target finder before the file target finder,
;; so we don't get a false positive match. ;; so we don't get a false positive match.
(let ((pos (or (cl-position (let ((pos (or (cl-position