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

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

[elpa] externals/corfu a44c778 1/2: Yet another hack: posn-at-point comp


From: ELPA Syncer
Subject: [elpa] externals/corfu a44c778 1/2: Yet another hack: posn-at-point computation returns wrong y-coordinate on Emacs 28
Date: Thu, 15 Jul 2021 06:57:09 -0400 (EDT)

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

    Yet another hack: posn-at-point computation returns wrong y-coordinate on 
Emacs 28
---
 corfu.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/corfu.el b/corfu.el
index 5151e9c..afeaab7 100644
--- a/corfu.el
+++ b/corfu.el
@@ -349,9 +349,13 @@ filter string with spaces is allowed."
                      (apply #'max corfu-min-width
                             (mapcar #'string-width lines))))
          (row 0)
-         (pos (posn-x-y (posn-at-point pos))))
+         ;;; 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.
+         (x (car (posn-x-y (posn-at-point pos))))
+         (y (cdr (posn-x-y (posn-at-point (point))))))
     (corfu--make-frame
-     (- (or (car pos) 0) mw) (or (cdr pos) 0)
+     (- (or x 0) mw) (or y 0)
      (+ (* width cw) mw mw) (* (length lines) ch)
      (mapconcat (lambda (line)
                   (let ((str (concat



reply via email to

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