branch: externals/vertico-posframe
commit 7f01bcff15a231afd46a161ce98ad391e092edf0
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>

    Better deal with vertico-posframe--advice.
    
        * vertico-posframe.el (vertico-posframe--advice): Update docstring.
        (vertico-posframe-mode): Handle vertico-posframe--advice.
---
 vertico-posframe.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/vertico-posframe.el b/vertico-posframe.el
index f80453e..933c2a1 100644
--- a/vertico-posframe.el
+++ b/vertico-posframe.el
@@ -229,8 +229,8 @@ When 0, no border is showed."
   (overlay-put vertico-posframe--overlay 'priority 1000)
   (overlay-put vertico-posframe--overlay 'before-string "\n"))
 
-(defun vertico-posframe--advice (orig &rest args)
-  "Advice function of `vertico--advice'."
+(defun vertico-posframe--advice (orig &rest _args)
+  "Advice for ORIG completion function, receiving ARGS."
   (setq vertico-posframe--last-window (selected-window)))
 
 ;;;###autoload
@@ -241,11 +241,13 @@ When 0, no border is showed."
    (vertico-posframe-mode
     (advice-add #'vertico--display-candidates :override 
#'vertico-posframe--display)
     (advice-add #'vertico--setup :after #'vertico-posframe--setup)
-    (advice-add #'vertico--advice :before #'vertico-posframe--advice))
+    (advice-add #'completing-read-default :before #'vertico-posframe--advice)
+    (advice-add #'completing-read-multiple :before #'vertico-posframe--advice))
    (t
     (advice-remove #'vertico--display-candidates #'vertico-posframe--display)
     (advice-remove #'vertico--setup #'vertico-posframe--setup)
-    (advice-remove #'vertico--advice #'vertico-posframe--advice)
+    (advice-remove #'completing-read-default #'vertico-posframe--advice)
+    (advice-remove #'completing-read-multiple #'vertico-posframe--advice)
     (posframe-delete vertico-posframe--buffer))))
 
 (provide 'vertico-posframe)

Reply via email to