branch: externals/vertico-posframe
commit e76a8e4ed3712d4ef14b982e0b7d8810c152dd0d
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>
* vertico-posframe.el (vertico-posframe-mode): Add and remove
post-command-hook: vertico-posframe-post-command-function
---
vertico-posframe.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/vertico-posframe.el b/vertico-posframe.el
index b02894d..5c1df0d 100644
--- a/vertico-posframe.el
+++ b/vertico-posframe.el
@@ -217,8 +217,6 @@ Optional argument FRAME ."
(posframe-hide vertico-posframe--buffer)
(posframe-hide vertico-posframe--minibuffer-cover)))
-(add-hook 'post-command-hook #'vertico-posframe-post-command-function)
-
(defun vertico-posframe-post-command-function ()
"`post-command-hook' function used by vertico-posframe."
(while-no-input
@@ -257,12 +255,14 @@ Optional argument FRAME ."
(advice-add #'vertico--display-candidates :override
#'vertico-posframe--display)
(advice-add #'vertico--setup :after #'vertico-posframe--setup)
(advice-add #'completing-read-default :before #'vertico-posframe--advice)
- (advice-add #'completing-read-multiple :before #'vertico-posframe--advice))
+ (advice-add #'completing-read-multiple :before #'vertico-posframe--advice)
+ (add-hook 'post-command-hook #'vertico-posframe-post-command-function))
(t
(advice-remove #'vertico--display-candidates #'vertico-posframe--display)
(advice-remove #'vertico--setup #'vertico-posframe--setup)
(advice-remove #'completing-read-default #'vertico-posframe--advice)
(advice-remove #'completing-read-multiple #'vertico-posframe--advice)
+ (remove-hook 'post-command-hook #'vertico-posframe-post-command-function)
(posframe-delete vertico-posframe--buffer))))
(provide 'vertico-posframe)