[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu-doc d611165b7d 42/95: Reduce the popup height to
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu-doc d611165b7d 42/95: Reduce the popup height to avoid exceeding the display |
Date: |
Tue, 19 Jul 2022 15:58:03 -0400 (EDT) |
branch: externals/corfu-doc
commit d611165b7d76b3362269e2697aca0e486e26f856
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>
Reduce the popup height to avoid exceeding the display
---
corfu-doc.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/corfu-doc.el b/corfu-doc.el
index 54be989a62..b4a7efc490 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -231,10 +231,12 @@ FWIDTH and FHEIGHT."
(cf-frame-y (cdr cf-frame--pos))
(cf-frame-width (frame-pixel-width corfu--frame))
(cf-frame-height (frame-pixel-height corfu--frame))
- (cf-parent-frame-x ;; corfu parent frame x pos
+ (cf-parent-frame-pos
;; Get inner frame left top edge for corfu frame's parent frame
;; See "(elisp) Frame Layout" in Emacs manual
- (car (cl-subseq (frame-edges cf-parent-frame 'inner) 0 2)))
+ (cl-subseq (frame-edges cf-parent-frame 'inner) 0 2))
+ (cf-parent-frame-x (car cf-parent-frame-pos))
+ (cf-parent-frame-y (cadr cf-parent-frame-pos))
(cf-parent-frame-width (frame-pixel-width cf-parent-frame))
(cf-doc-frame-width
(or fwidth
@@ -262,6 +264,7 @@ FWIDTH and FHEIGHT."
(- (frame-pixel-height corfu-doc--frame) 1 1))))
(display-geometry (assq 'geometry (frame-monitor-attributes
corfu--frame)))
(display-width (nth 3 display-geometry))
+ (display-height (nth 4 display-geometry))
(display-x (nth 1 display-geometry))
(cf-parent-frame-rel-x (- cf-parent-frame-x display-x))
(display-space-right
@@ -307,7 +310,14 @@ FWIDTH and FHEIGHT."
(if (< y-on-top-side-of-cf-frame 0)
(setq cf-doc-frame-height
(- cf-frame-y y 1 1 space))))
- (t (setq y y-on-bottom-side-of-cf-frame)))))))
+ (t (setq y y-on-bottom-side-of-cf-frame))))))
+ ;; reduce the popup height to avoid exceeding the display
+ (unless (= x cf-frame-x)
+ (let ((lh (default-line-height))
+ (height-remaining (- display-height 1 1 y cf-parent-frame-y)))
+ (when (< height-remaining cf-doc-frame-height)
+ (setq cf-doc-frame-height
+ (* (floor (/ height-remaining lh)) lh))))))
(list x y cf-doc-frame-width cf-doc-frame-height)))
(defun corfu-doc--get-candidate ()
- [elpa] branch externals/corfu-doc created (now da93136780), ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 11b9f0fefa 18/95: Add an option to resize the corfu doc frame automatically, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d611165b7d 42/95: Reduce the popup height to avoid exceeding the display,
ELPA Syncer <=
- [elpa] externals/corfu-doc c14d42e5e2 55/95: Version 0.4.3, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc c968530f74 50/95: Fix #9: fix showing doc while quickly browsing candidates, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc e9562c3936 48/95: Update commentary, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d857f012ad 33/95: Reduce doc frame flickering when the delay is very low, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 45853ecb53 24/95: Version 0.1.0, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc dcc481a5d0 58/95: Document display the doc frame within the parent frame, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc e1c79e8ffc 27/95: Version 0.1.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 1fd578caa0 53/95: Fix link, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d2abf185e6 75/95: Rename corfu-doc--popup-transit to corfu-doc--popup-transition, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 07d389a0ab 74/95: Make candidates popup and doc popup share the border, ELPA Syncer, 2022/07/19