branch: externals/ivy-hydra
commit f3f4c8c4b8981963922ca8d58b2e0b50615bf0cb
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    Fix ivy-auto-shrink-minibuffer regression
    
    * ivy.el (ivy-auto-shrink-minibuffer): Mark it as obsolete and not
    as a varalias of the new ivy-auto-shrink-minibuffer-alist, as their
    types are incompatible.
    
    Re: #2516
    Fixes #2540
---
 ivy.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8b2aaa7..1664796 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3459,10 +3459,12 @@ Should be run via minibuffer `post-command-hook'."
         (when (region-active-p)
           (set-mark old-mark))))))
 
-(define-obsolete-variable-alias
-    'ivy-auto-shrink-minibuffer
-    'ivy-auto-shrink-minibuffer-alist
-  "<2020-04-28 Tue>")
+(defvar ivy-auto-shrink-minibuffer nil
+  "When non-nil and the height < `ivy-height', auto-shrink the minibuffer.")
+
+(make-obsolete-variable 'ivy-auto-shrink-minibuffer
+                        'ivy-auto-shrink-minibuffer-alist
+                        "<2020-04-28 Tue>")
 
 (defcustom ivy-auto-shrink-minibuffer-alist nil
   "An alist to configure auto-shrinking of the minibuffer.
@@ -3490,7 +3492,8 @@ height < `ivy-height', auto-shrink the minibuffer."
                    (let ((delta (max (- text-height body-height)
                                      (frame-char-height))))
                      (window-resize nil delta nil t t)))
-                  ((and (ivy-alist-setting ivy-auto-shrink-minibuffer)
+                  ((and (or ivy-auto-shrink-minibuffer
+                            (ivy-alist-setting ivy-auto-shrink-minibuffer))
                         (< ivy--length ivy-height))
                    (shrink-window (-
                                    (/ (window-body-height nil t)

Reply via email to