branch: externals/ivy-hydra
commit c6f6f9a0479b5a57db8fa5d240e38349d271224d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy-overlay.el (ivy-overlay-show-after): Improve available-height
calculation
If we're close to `window-end', especially when adding text at the end
of the buffer, `available-height' was calculated too small.
---
ivy-overlay.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ivy-overlay.el b/ivy-overlay.el
index 7a77bcf..8c873a2 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -73,7 +73,7 @@ Then attach the overlay to the character before point."
(progn
(move-overlay ivy-overlay-at (1- (point)) (line-end-position))
(overlay-put ivy-overlay-at 'invisible nil))
- (let ((available-height (count-lines (point) (window-end nil t))))
+ (let ((available-height (- (window-height) (count-lines (window-start)
(point)) 1)))
(unless (>= available-height ivy-height)
(recenter (- (window-height) ivy-height 2))))
(setq ivy-overlay-at (make-overlay (1- (point)) (line-end-position)))