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.
|
||||
Symbol ‘left’ if the selected window is on the left, ‘right’ if
|
||||
on the right. Return ‘left’ if there is only one window."
|
||||
(let ((left-window (if tab-bar-mode
|
||||
(window-at-x-y 5 (+ 5 (tab-bar-height nil t)))
|
||||
(window-at 0 0))))
|
||||
;; Get the window at point (x, y), where x = 0, y = the y coordinate
|
||||
;; of point. If this window is the selected window, the selected
|
||||
;; 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))
|
||||
'left
|
||||
'right)))
|
||||
|
Loading…
Reference in New Issue
Block a user