emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu c96071f977: Align popups at the bottom when the d


From: ELPA Syncer
Subject: [elpa] externals/corfu c96071f977: Align popups at the bottom when the doc popup is taller than the candidates popup and limit height of the doc popup to avoid exceeding the parent frame (#273)
Date: Mon, 5 Dec 2022 12:57:33 -0500 (EST)

branch: externals/corfu
commit c96071f9776dd624ab81c3873bec032eae1f9a15
Author: galeo <galeo@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Align popups at the bottom when the doc popup is taller than the candidates 
popup and limit height of the doc popup to avoid exceeding the parent frame 
(#273)
    
    * corfu-popupinfo: Align popups at the bottom when doc popup is taller
    
    (#271)
    
    * corfu-popupinfo: Ensure y value is not negative (#271)
    
    * corfu-popupinfo: Limit popup height to avoid exceeding the parent frame
    
    * Minor simplification
    
    Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
---
 extensions/corfu-popupinfo.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index d0cee7bcca..038253f4a4 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -291,14 +291,20 @@ form (X Y WIDTH HEIGHT DIR)."
                (below (>= cfy (+ lh (cadr (window-inside-pixel-edges))
                                  (window-tab-line-height)
                                  (or (cdr (posn-x-y (posn-at-point (point)))) 
0))))
+               ;; Popups aligned at top
+               (top-aligned (or below (< (cdr ps) cfh)))
                ;; Left display area
-               (ahy (if below cfy (- (+ cfy cfh) (cdr ps) border border)))
+               (ahy (if top-aligned
+                        cfy
+                      (max 0 (- (+ cfy cfh) border border (cdr ps)))))
+               (ahh (if top-aligned
+                        (min (- pfh cfy) (cdr ps))
+                      (min (- (+ cfy cfh) border border) (cdr ps))))
                (al (list (max 0 (- cfx (car ps) border)) ahy
-                         (min (- cfx border) (car ps)) (cdr ps) 'left))
+                         (min (- cfx border) (car ps)) ahh 'left))
                ;; Right display area
                (arx (+ cfx cfw (- border)))
-               (ar (list arx ahy (min (- pfw arx border border) (car ps))
-                         (cdr ps) 'right))
+               (ar (list arx ahy (min (- pfw arx border border) (car ps)) ahh 
'right))
                ;; Vertical display area
                (avw (min (car ps) (- pfw cfx border border)))
                (av (if below



reply via email to

[Prev in Thread] Current Thread [Next in Thread]