Fix at point position function
This commit is contained in:
parent
c4af2c7e23
commit
8f71b3c65e
11
eldoc-box.el
11
eldoc-box.el
@ -169,13 +169,16 @@ Position is calculated base on WIDTH and HEIGHT of chilframe text window"
|
|||||||
;; y position + a little padding (16)
|
;; y position + a little padding (16)
|
||||||
16))
|
16))
|
||||||
|
|
||||||
(defun eldoc-box--default-at-point-position-function (width _)
|
(defun eldoc-box--default-at-point-position-function (width height)
|
||||||
"Set `eldoc-box-position-function' to this function to have childframe appear under point.
|
"Set `eldoc-box-position-function' to this function to have childframe appear under point.
|
||||||
Position is calculated base on WIDTH and HEIGHT of chilframe text window"
|
Position is calculated base on WIDTH and HEIGHT of chilframe text window"
|
||||||
(let ((point-pos (window-absolute-pixel-position)))
|
(let ((point-pos (window-absolute-pixel-position)))
|
||||||
(cons (+ 16 (car point-pos)) (- (min (cdr point-pos)
|
(cons (- (min (car point-pos)
|
||||||
(frame-outer-width (selected-frame)))
|
(- (frame-outer-width (selected-frame)) width))
|
||||||
16))))
|
50)
|
||||||
|
(if (< (- (frame-outer-height (selected-frame)) height) (cdr point-pos))
|
||||||
|
(- (cdr point-pos) height)
|
||||||
|
(- (cdr point-pos) 20)))))
|
||||||
|
|
||||||
(defun eldoc-box--get-frame (buffer)
|
(defun eldoc-box--get-frame (buffer)
|
||||||
"Return a childframe displaying BUFFER.
|
"Return a childframe displaying BUFFER.
|
||||||
|
Loading…
Reference in New Issue
Block a user