[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 4a6e5df2fb 1/3: corfu-popupinfo: Make sure the po
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 4a6e5df2fb 1/3: corfu-popupinfo: Make sure the popup has a minimum height of 1 line (#261) |
Date: |
Thu, 24 Nov 2022 08:57:26 -0500 (EST) |
branch: externals/corfu
commit 4a6e5df2fb139d8402b4171b2f036b3a12372230
Author: galeo <galeo@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
corfu-popupinfo: Make sure the popup has a minimum height of 1 line (#261)
---
extensions/corfu-popupinfo.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index d82d1249c2..0eba0279ca 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -219,9 +219,10 @@ all values are in pixels relative to the origin. See
(defun corfu-popupinfo--size ()
"Return popup size as pair."
(let* ((cw (default-font-width))
+ (lh (default-line-height))
(margin (* cw (+ (alist-get 'left-margin-width
corfu-popupinfo--buffer-parameters)
(alist-get 'right-margin-width
corfu-popupinfo--buffer-parameters))))
- (max-height (* (default-line-height) corfu-popupinfo-max-height))
+ (max-height (* lh corfu-popupinfo-max-height))
(max-width (* cw corfu-popupinfo-max-width)))
(or (when corfu-popupinfo-resize
(with-current-buffer " *corfu-popupinfo*"
@@ -233,7 +234,8 @@ all values are in pixels relative to the origin. See
;; Check that width is not exceeded. Otherwise use full height,
;; since lines will get wrapped.
(when (<= (car size) max-width)
- (cons (+ margin (car size)) (min (cdr size) max-height))))))
+ (cons (+ margin (car size))
+ (min (max (cdr size) lh) max-height))))))
(cons (+ margin max-width) max-height))))
(defun corfu-popupinfo--frame-geometry (frame)