From 913786070769fac83e7b8ef790b57c8d8cbf8853 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sat, 2 Nov 2019 10:33:49 -0400 Subject: [PATCH] Fix window position-finding --- eldoc-box.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eldoc-box.el b/eldoc-box.el index fdc6205..0c2fd17 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -247,13 +247,12 @@ Position is calculated base on WIDTH and HEIGHT of childframe text window" The coordinate is relative to the native frame. WINDOW nil means use selected window." - (let* ((pos (posn-at-point point window)) - (x-y (posn-x-y pos)) - (window (posn-window pos)) + (let* ((pos (pos-visible-in-window-p point window t)) + (x (car pos)) + (y (cadr pos)) (edges (window-body-pixel-edges window))) - (cons (+ (car x-y) (car edges)) - (+ (cdr x-y) (cadr edges) - (- (window-header-line-height window)))))) + (cons (+ x (car edges)) + (+ y (cadr edges))))) (defun eldoc-box--default-at-point-position-function-1 (width height) "See `eldoc-box--default-at-point-position-function'."