]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy.el
Add ivy-fixed-height-minibuffer
[gnu-emacs-elpa] / ivy.el
diff --git a/ivy.el b/ivy.el
index 84d4af79855416a4349148824926cf129d40e825..c16b7afefaa46d9d39cc35db39295fcafa0125c3 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1728,6 +1728,14 @@ Insert .* between each char."
         (setq ivy--subexps (length (match-string 2 str))))
     str))
 
+(defcustom ivy-fixed-height-minibuffer nil
+  "When non nil, fix the height of the minibuffer during ivy
+completion at `ivy-height'. This effectively sets the minimum
+height at this level and tries to ensure that it does not change
+depending on the number of candidates."
+  :group 'ivy
+  :type 'boolean)
+
 ;;** Rest
 (defun ivy--minibuffer-setup ()
   "Setup ivy completion in the minibuffer."
@@ -1738,6 +1746,8 @@ Insert .* between each char."
   (when (display-graphic-p)
     (setq truncate-lines t))
   (setq-local max-mini-window-height ivy-height)
+  (when ivy-fixed-height-minibuffer
+    (set-window-text-height (selected-window) ivy-height))
   (add-hook 'post-command-hook #'ivy--exhibit nil t)
   ;; show completions with empty input
   (ivy--exhibit))