branch: master
commit aef1242b86aaffc9bab4a7c553ce9d003e754f53
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy-overlay.el (ivy-overlay-impossible-p): Simplify
Avoid situation where `ivy-overlay-impossible-p' changes value as the
user types new input. The overlay will fit anyway because of
`ivy--trucate-string'.
---
ivy-overlay.el | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ivy-overlay.el b/ivy-overlay.el
index 5a2e5e7..1d4305c 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -88,16 +88,14 @@ Then attach the overlay to the character before point."
(declare-function ivy-state-window "ivy")
(declare-function ivy--remove-prefix "ivy")
-(defun ivy-overlay-impossible-p (str)
+(defun ivy-overlay-impossible-p (_str)
(or
(and (eq major-mode 'org-mode)
(plist-get (text-properties-at (point)) 'src-block))
(<= (window-height) (+ ivy-height 3))
(= (point) (point-min))
(< (- (+ (window-width) (window-hscroll)) (current-column))
- (apply #'max
- (mapcar #'string-width
- (split-string str "\n"))))))
+ 30)))
(defun ivy-display-function-overlay (str)
"Called from the minibuffer, display STR in an overlay in Ivy window.