From 616fdabd8d7a48a174397c5e30eb52272f05d351 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 18:31:16 +0800 Subject: [PATCH] Fix: set current window after switching window. --- doom-modeline.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 82245a5..76e4297 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -243,17 +243,17 @@ If STRICT-P, return nil if no project was found, otherwise return (force-mode-line-update)) (add-hook 'window-configuration-change-hook #'doom-modeline-set-selected-window) -(add-hook 'doom-after-switch-window-hook #'doom-modeline-set-selected-window) +(add-hook 'switch-window-finish-hook #'doom-modeline-set-selected-window) (with-no-warnings (if (not (boundp 'after-focus-change-function)) (progn (add-hook 'focus-in-hook #'doom-modeline-set-selected-window) (add-hook 'focus-out-hook #'doom-modeline-unset-selected-window)) (defun doom-modeline-refresh-frame () - (setq +doom-modeline-current-window nil) + (setq doom-modeline-current-window nil) (cl-loop for frame in (frame-list) if (eq (frame-focus-state frame) t) - return (setq +doom-modeline-current-window (frame-selected-window frame))) + return (setq doom-modeline-current-window (frame-selected-window frame))) (force-mode-line-update)) (add-function :after after-focus-change-function #'doom-modeline-refresh-frame)))