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

    ivy-overlay.el (ivy-overlay-impossible-p): Check for point-min
    
    Fixes #1267
---
 ivy-overlay.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ivy-overlay.el b/ivy-overlay.el
index 9cd79da..f78fbfc 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -82,18 +82,21 @@ Then attach the overlay the character before point."
 (defvar ivy-completion-beg)
 (declare-function ivy--get-window "ivy")
 
-(defun ivy-overlay-possible-p ()
+(defun ivy-overlay-impossible-p ()
   (or
    (< (- (window-width) (current-column))
       (length (ivy-state-current ivy-last)))
-   (<= (window-height) (+ ivy-height 3))))
+   (<= (window-height) (+ ivy-height 3))
+   (= (point) (point-min))
+   (and (eq major-mode 'org-mode)
+        (bound-and-true-p org-indent-mode))))
 
 (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))
-        (ivy-overlay-possible-p))
+        (ivy-overlay-impossible-p))
       (let ((buffer-undo-list t))
         (save-excursion
           (forward-line 1)

Reply via email to