branch: master
commit 1c04fb8659b03eae00a05464ed09b17f7e6767b1
Author: justbur <[email protected]>
Commit: Oleh Krehel <[email protected]>
Add ivy-fixed-height-minibuffer
This option attempts to make the minibuffer stay at a fixed height
regardless of the number of candidates. Some people prefer this as
it can be annoying when quickly going through folders of different
sizes for example
Fixes #353
---
ivy.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ivy.el b/ivy.el
index 84d4af7..c16b7af 100644
--- 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))