From 1c2c45c888dc125ba91b3ea8ae6d6a2659b4961a Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sat, 4 Mar 2023 22:46:40 -0800 Subject: [PATCH] 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. --- eldoc-box.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eldoc-box.el b/eldoc-box.el index e22fde9..90805fb 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -280,7 +280,9 @@ 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 (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)) 'left 'right)))