branch: master
commit 3cd76371d1213f9bb8142b99b0ab3eda1cf3fffe
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    ivy-overlay.el: Expect window to be 1 row taller
    
    Re #1247
---
 ivy-overlay.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ivy-overlay.el b/ivy-overlay.el
index c063421..9cd79da 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -82,15 +82,18 @@ Then attach the overlay the character before point."
 (defvar ivy-completion-beg)
 (declare-function ivy--get-window "ivy")
 
+(defun ivy-overlay-possible-p ()
+  (or
+   (< (- (window-width) (current-column))
+      (length (ivy-state-current ivy-last)))
+   (<= (window-height) (+ ivy-height 3))))
+
 (defun ivy-display-function-overlay (str)
   "Called from the minibuffer, display STR in an overlay in Ivy window.
 Hide the minibuffer contents and cursor."
   (if (save-selected-window
         (select-window (ivy-state-window ivy-last))
-        (or
-         (< (- (window-width) (current-column))
-            (length (ivy-state-current ivy-last)))
-         (<= (window-height) (+ ivy-height 2))))
+        (ivy-overlay-possible-p))
       (let ((buffer-undo-list t))
         (save-excursion
           (forward-line 1)

Reply via email to