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

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

[elpa] externals/corfu 5df80e26b1: corfu-popupinfo: Ensure that x-positi


From: ELPA Syncer
Subject: [elpa] externals/corfu 5df80e26b1: corfu-popupinfo: Ensure that x-position is positive (Fix #263)
Date: Sat, 26 Nov 2022 12:57:26 -0500 (EST)

branch: externals/corfu
commit 5df80e26b1d365fa0bb9250186d8d1ec5ab46cdf
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    corfu-popupinfo: Ensure that x-position is positive (Fix #263)
---
 corfu.el                      | 4 ++--
 extensions/corfu-popupinfo.el | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/corfu.el b/corfu.el
index b796d0334f..fe63b7c2a2 100644
--- a/corfu.el
+++ b/corfu.el
@@ -454,8 +454,8 @@ A scroll bar is displayed from LO to LO+BAR."
          (height (* (length lines) ch))
          (edge (window-inside-pixel-edges))
          (border (alist-get 'child-frame-border-width corfu--frame-parameters))
-         (x (max border (min (+ (car edge) (- (or (car pos) 0) ml (* cw off) 
border))
-                             (- (frame-pixel-width) width))))
+         (x (max 0 (min (+ (car edge) (- (or (car pos) 0) ml (* cw off) 
border))
+                        (- (frame-pixel-width) width))))
          (yb (+ (cadr edge) (window-tab-line-height) (or (cdr pos) 0) ch))
          (y (if (> (+ yb (* corfu-count ch) ch ch) (frame-pixel-height))
                 (- yb height ch 1)
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 39e84bc530..972ef21baf 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -259,7 +259,7 @@ relative to the candidate popup, its value can be right or 
left."
                 (corfu-popupinfo--frame-geometry (frame-parent corfu--frame)))
                (`(,cfx ,cfy ,cfw ,_cfh) (corfu-popupinfo--frame-geometry 
corfu--frame))
                (x-on-right (+ cfx cfw (- border)))
-               (x-on-left (- cfx width border))
+               (x-on-left (max 0 (- cfx width border)))
                (w-remaining-right (- pfw 1 x-on-right border border))
                (w-remaining-left (- cfx 1 border)))
     (cond



reply via email to

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