[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 2620355 2/2: Better y-position computation
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 2620355 2/2: Better y-position computation |
Date: |
Thu, 15 Jul 2021 11:57:09 -0400 (EDT) |
branch: externals/corfu
commit 2620355524786f5be670ee128ff482221a2097be
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Better y-position computation
---
corfu.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/corfu.el b/corfu.el
index 5b78cbe..ebb1d21 100644
--- a/corfu.el
+++ b/corfu.el
@@ -350,11 +350,14 @@ filter string with spaces is allowed."
(apply #'max corfu-min-width
(mapcar #'string-width lines))))
(row 0)
- ;;; XXX HACK y-coordinate position computation is wrong
- ;;; if there exists a flymake underline overlay at that point.
- ;;; Take the y coordinate from the current point.
+ ;;; XXX HACK On Emacs 28 y-coordinate position computation is wrong if
+ ;;; there exists a flymake underline overlay at that point. Therefore
+ ;;; compute the y-coordinate at the line beginning.
(x (or (car (posn-x-y (posn-at-point pos))) 0))
- (y (or (cdr (posn-x-y (posn-at-point (point)))) 0)))
+ (y (save-excursion
+ (goto-char pos)
+ (beginning-of-line)
+ (or (cdr (posn-x-y (posn-at-point))) 0))))
(corfu--make-frame
(- x mw) y
(+ (* width cw) mw mw) (* (length lines) ch)