branch: externals/ivy-posframe
commit c9a7331ee44e32d5f1fc3c392ec138f41961532e
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>

    handle ivy-display-function
---
 ivy-posframe.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index ef86418..e2897a3 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -518,13 +518,15 @@ selection, non-nil otherwise."
             ([remap ivy-avy] ivy-posframe-avy)
             ([remap swiper-avy] ivy-posframe-swiper-avy))
   (let ((advices ivy-posframe-advice-alist))
-    (if ivy-posframe-mode
+    (if ivy-display-function
+        (message "ivy-posframe: `ivy-display-function' is used, so 
ivy-posframe-mode can not enable.")
+      (if ivy-posframe-mode
+          (mapcar (lambda (elm)
+                    (advice-add (car elm) :around (cdr elm)))
+                  advices)
         (mapcar (lambda (elm)
-                  (advice-add (car elm) :around (cdr elm)))
-                advices)
-      (mapcar (lambda (elm)
-                (advice-remove (car elm) (cdr elm)))
-              advices))))
+                  (advice-remove (car elm) (cdr elm)))
+                advices)))))
 
 ;;;###autoload
 (defun ivy-posframe-enable ()

Reply via email to