Improve eldoc-box--window-side
* eldoc-box.el (eldoc-box--window-side): Now it consistently returns 'left' even if the left side is split vertically.
This commit is contained in:
parent
ee7c978887
commit
e58ecc4699
10
eldoc-box.el
10
eldoc-box.el
@ -320,9 +320,13 @@ STR has to be a proper documentation, not empty string, not nil, etc."
|
|||||||
"Return the side of the selected window.
|
"Return the side of the selected window.
|
||||||
Symbol ‘left’ if the selected window is on the left, ‘right’ if
|
Symbol ‘left’ if the selected window is on the left, ‘right’ if
|
||||||
on the right. Return ‘left’ if there is only one window."
|
on the right. Return ‘left’ if there is only one window."
|
||||||
(let ((left-window (if tab-bar-mode
|
;; Get the window at point (x, y), where x = 0, y = the y coordinate
|
||||||
(window-at-x-y 5 (+ 5 (tab-bar-height nil t)))
|
;; of point. If this window is the selected window, the selected
|
||||||
(window-at 0 0))))
|
;; window is on the left, otherwise the selected window is on the
|
||||||
|
;; right.
|
||||||
|
(let* ((y (cdr (posn-x-y (posn-at-point))))
|
||||||
|
(top (nth 1 (window-absolute-pixel-edges (selected-window))))
|
||||||
|
(left-window (window-at-x-y 0 (+ y top))))
|
||||||
(if (eq left-window (selected-window))
|
(if (eq left-window (selected-window))
|
||||||
'left
|
'left
|
||||||
'right)))
|
'right)))
|
||||||
|
Loading…
Reference in New Issue
Block a user