fix(vertico): gate which-key integration

This prevents an error for users disabling which-key.
This commit is contained in:
Liam Hupfer 2023-09-02 11:44:48 -05:00
parent b261afe59d
commit 3d82e3d46d

View file

@ -253,6 +253,7 @@ orderless."
(set-popup-rule! "^\\*Embark Export:" :size 0.35 :ttl 0 :quit nil) (set-popup-rule! "^\\*Embark Export:" :size 0.35 :ttl 0 :quit nil)
(after! which-key
(defadvice! +vertico--embark-which-key-prompt-a (fn &rest args) (defadvice! +vertico--embark-which-key-prompt-a (fn &rest args)
"Hide the which-key indicator immediately when using the completing-read prompter." "Hide the which-key indicator immediately when using the completing-read prompter."
:around #'embark-completing-read-prompter :around #'embark-completing-read-prompter
@ -260,7 +261,8 @@ orderless."
(let ((embark-indicators (let ((embark-indicators
(remq #'embark-which-key-indicator embark-indicators))) (remq #'embark-which-key-indicator embark-indicators)))
(apply fn args))) (apply fn args)))
(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 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