branch: externals/corfu commit 2620355524786f5be670ee128ff482221a2097be Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@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)