mirror of
https://github.com/correl/doom-modeline.git
synced 2024-12-25 19:25:39 +00:00
Fix #103: Segments sometimes get stuck with inactive face.
Select current window, but should exclude the child windows.
This commit is contained in:
parent
54a5f45182
commit
0feb1c1499
1 changed files with 8 additions and 2 deletions
|
@ -344,10 +344,16 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
|||
(eldoc-in-minibuffer-mode 1)
|
||||
|
||||
;; Keep `doom-modeline-current-window' up-to-date
|
||||
(defvar doom-modeline-current-window (frame-selected-window))
|
||||
(defun doom-modeline--get-current-window ()
|
||||
"Get the current window but should exclude the child windows."
|
||||
(if (and (fboundp 'frame-parent) (frame-parent))
|
||||
(frame-selected-window (frame-parent))
|
||||
(frame-selected-window)))
|
||||
|
||||
(defvar doom-modeline-current-window (doom-modeline--get-current-window))
|
||||
(defun doom-modeline-set-selected-window (&rest _)
|
||||
"Set `doom-modeline-current-window' appropriately."
|
||||
(when-let ((win (frame-selected-window)))
|
||||
(when-let ((win (doom-modeline--get-current-window)))
|
||||
(unless (minibuffer-window-active-p win)
|
||||
(setq doom-modeline-current-window win)
|
||||
(force-mode-line-update))))
|
||||
|
|
Loading…
Reference in a new issue