summaryrefslogtreecommitdiff
path: root/extensions/corfu-popupinfo.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-02-05 21:10:50 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-02-05 21:12:02 +0100
commit4e54225cd25157f6b8cbbc69644b0d9f209030f6 (patch)
tree12ddcd759dd1cda7afab87fa7befbb8be501172c /extensions/corfu-popupinfo.el
parent7360eab959ce521bc89a8aec30d868b8c727a70a (diff)
corfu-popupinfo: Use larger y-limit for size computation
Sometimes the first lines of the documentation are shorter than the following text, which led to wrapping when scrolling the popup.
Diffstat (limited to 'extensions/corfu-popupinfo.el')
-rw-r--r--extensions/corfu-popupinfo.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 6a46edd..c44169d 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -242,7 +242,9 @@ all values are in pixels relative to the origin. See
((window-buffer) (current-buffer))
(size (window-text-pixel-size
nil (point-min) (point-max)
- max-width max-height)))
+ ;; Use 3*max-height as y-limit, to take more text
+ ;; into account.
+ max-width (* 3 max-height))))
;; Check that width is not exceeded. Otherwise use full height,
;; since lines will get wrapped.
(when (<= (car size) max-width)