From 423939033f155d5c62d5dc8a54e69c6a156fd98e Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Sun, 17 Oct 2021 14:34:38 +0300 Subject: [PATCH] fix(vertico): which-key buffer on embark prompter The which-key buffer now disappears immediately on using embark-completing-read-prompter, instead of only after further user input. --- modules/completion/vertico/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index 40588d591..f766f4785 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -168,6 +168,14 @@ orderless." :desc "Actions" "a" #'embark-act)) ; to be moved to :config default if accepted :config (set-popup-rule! "^\\*Embark Export Grep" :size 0.35 :ttl 0 :quit nil) + + (defadvice! +vertico--embark-which-key-prompt-a (fn &rest args) + "Hide the which-key indicator immediately when using the completing-read prompter." + :around #'embark-completing-read-prompter + (which-key--hide-popup-ignore-command) + (let ((embark-indicators + (remq #'embark-which-key-indicator embark-indicators))) + (apply fn args))) (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,