[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra eae1ccf 086/395: ivy.el (ivy-auto-shrink-mini
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra eae1ccf 086/395: ivy.el (ivy-auto-shrink-minibuffer): New defcustom |
Date: |
Thu, 25 Feb 2021 08:31:37 -0500 (EST) |
branch: externals/ivy-hydra
commit eae1ccf6f0292830c90059b7b24f396432de02d6
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy-auto-shrink-minibuffer): New defcustom
Fixes #649
Fixes #2389
---
ivy.el | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/ivy.el b/ivy.el
index 1748de3..c90276b 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3332,6 +3332,10 @@ Should be run via minibuffer `post-command-hook'."
(when (region-active-p)
(set-mark old-mark))))))
+(defcustom ivy-auto-shrink-minibuffer nil
+ "When non-nil and the height < `ivy-height', auto-shrink the minibuffer."
+ :type 'boolean)
+
(defun ivy--resize-minibuffer-to-fit ()
"Resize the minibuffer window size to fit the text in the minibuffer."
(unless (frame-root-window-p (minibuffer-window))
@@ -3339,13 +3343,19 @@ Should be run via minibuffer `post-command-hook'."
(if (fboundp 'window-text-pixel-size)
(let ((text-height (cdr (window-text-pixel-size)))
(body-height (window-body-height nil t)))
- (when (> text-height body-height)
- ;; 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))))
+ (cond ((> text-height body-height)
+ ;; 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)))
+ ((and ivy-auto-shrink-minibuffer
+ (< ivy--length ivy-height))
+ (shrink-window (-
+ (/ (window-body-height nil t)
+ (frame-char-height))
+ ivy--length 1)))))
(let ((text-height (count-screen-lines))
(body-height (window-body-height)))
(when (> text-height body-height)
- [elpa] externals/ivy-hydra 1396d7b 024/395: counsel.el (counsel-grep): Obey ivy-case-fold-search-default, (continued)
- [elpa] externals/ivy-hydra 1396d7b 024/395: counsel.el (counsel-grep): Obey ivy-case-fold-search-default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2ccda7e 044/395: ivy.el (ivy--directory-done): Fix "Host name must not match method ssh", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra a7ae5f0 058/395: counsel.el (counsel-geiser-doc-look-up-manual): Add., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 13a1b87 059/395: ivy.el (ivy-minibuffer-map): Bind "M-a" to ivy-toggle-marks, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 49335d2 060/395: Allow to use window configurations for ivy views, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0f61cc5 065/395: Add support for browising compilation errors, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2fb4c9f 061/395: Update test instructions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3d9c222 069/395: swiper.el (swiper--query-replace-updatefn): Fix, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c7973a8 083/395: counsel.el (counsel-set-variable): Fix killing the expression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e7eca37 085/395: counsel.el (counsel-switch-buffer-preview-virtual-buffers): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra eae1ccf 086/395: ivy.el (ivy-auto-shrink-minibuffer): New defcustom,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra f16e6e2 094/395: counsel.el (counsel-flycheck-errors-cands): Show the error, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 400a900 265/395: ivy.el (ivy-backward-delete-char): Forward to counsel-up-directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra edccbd7 270/395: ivy.el (ivy-completion-in-region): Use collection in place of all-completions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0f4cb44 051/395: ivy.el (ivy-add-prompt-count): Account for :dynamic-collection returning 0, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra cab01f3 053/395: ivy.el (ivy--reset-state): Add listp check, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra abfb283 054/395: ivy-overlay.el (ivy-display-function-overlay): Fix for org-current-level, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 06886f1 055/395: ivy.el (ivy--tramp-prefix-p): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d2052ba 017/395: counsel.el (counsel--company-display-transformer): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1020a77 026/395: swiper.el (swiper-query-replace): Show matched groups in preview, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c0b61ea 028/395: swiper.el (swiper--query-replace-setup): Highlight at eobp, Basil L. Contovounesios, 2021/02/25