Very small size increments can be necessary if the initial candidate
list is short (e.g. 3 items) and line-height is set to something other
than zero. In that case, only half of the last line is initially
visible. ivy--resize-minibuffer-to-fit recognizes this and tries to
enlarge the window up the the exact pixel height required, however
window-resize doesn't do anything if the delta is below
frame-char-height.
(let ((text-height (cdr (window-text-pixel-size)))
(body-height (window-body-height nil t)))
(when (> text-height body-height)
- (window-resize nil (- text-height body-height) nil t t)))
+ ;; Note: the size increment needs to be at least frame-char-height,
+ ;; otherwise resizing won't do anything.
+ (let ((delta (max (- text-height body-height) (frame-char-height))))
+ (window-resize nil delta nil t t))))
(let ((text-height (count-screen-lines))
(body-height (window-body-height)))
(when (> text-height body-height)