Handle tab-bar gracefully

When tab-bar-mode is on, (window-at 0 0) returns nil (because the
tab-bar is on that position), throwing off eldoc-box--window-side.

* eldoc-box.el (eldoc-box--window-side): Handle tab-bar differently.
This commit is contained in:
Yuan Fu 2023-03-04 22:46:40 -08:00
parent 6c7b3376bd
commit 1c2c45c888
No known key found for this signature in database
GPG Key ID: 56E19BC57664A442

View File

@ -280,7 +280,9 @@ 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 (window-at 0 0))) (let ((left-window (if tab-bar-mode
(window-at-x-y 5 (+ 5 (tab-bar-height nil t)))
(window-at 0 0))))
(if (eq left-window (selected-window)) (if (eq left-window (selected-window))
'left 'left
'right))) 'right)))