[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 8bf043d 2/4: Fix resizing if there are no candi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vertico 8bf043d 2/4: Fix resizing if there are no candidates and vertico-resize=nil (Fix #75) |
Date: |
Wed, 7 Jul 2021 15:57:19 -0400 (EDT) |
branch: externals/vertico
commit 8bf043d9f7c256b83b9709808c8394f7d051d4ca
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Fix resizing if there are no candidates and vertico-resize=nil (Fix #75)
---
vertico.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/vertico.el b/vertico.el
index 7dbe400..59e64a6 100644
--- a/vertico.el
+++ b/vertico.el
@@ -477,14 +477,16 @@ See `resize-mini-windows' for documentation."
(defun vertico--resize-window (height)
"Resize active minibuffer window to HEIGHT."
+ (unless vertico-resize
+ (setq height (max height vertico-count)))
(setq-local truncate-lines (< (point-max) (- (window-width) 4)))
(unless (frame-root-window-p (active-minibuffer-window))
(let* ((window-resize-pixelwise t)
(dp (- (max (cdr (window-text-pixel-size))
- (* (default-line-height) (1+ (if vertico-resize height
vertico-count))))
+ (* (default-line-height) (1+ height)))
(window-pixel-height))))
- (when (and (or (/= height 0) (< dp 0))
- (or (> dp 0) (eq vertico-resize t)))
+ (when (or (and (> dp 0) (/= height 0))
+ (and (< dp 0) (eq vertico-resize t)))
(window-resize nil dp nil nil 'pixelwise)))))
(defun vertico--display-count ()