Refresh the mode-line forcedly after switching frames.

This commit is contained in:
Vincent Zhang 2019-06-06 18:20:18 +08:00
parent 94ddb2f68b
commit 62f48c062e
2 changed files with 4 additions and 1 deletions

View file

@ -441,6 +441,9 @@ If the actual char height is larger, it respects the actual char height.")
(add-hook 'after-make-frame-functions #'doom-modeline-set-selected-window)
(add-hook 'delete-frame-functions #'doom-modeline-set-selected-window)
(advice-add #'handle-switch-frame :after #'doom-modeline-set-selected-window)
(advice-add #'handle-switch-frame :after #'(lambda (&rest _)
"Rever the current buffer."
(ignore-errors (revert-buffer t t))))
(with-no-warnings
(cond ((not (boundp 'after-focus-change-function))
(add-hook 'focus-in-hook #'doom-modeline-set-selected-window)

View file

@ -1656,7 +1656,7 @@ mouse-1: Reload to start server")
(define-key map [mode-line mouse-1]
(lambda ()
(interactive)
(revert-buffer t t)))))
(ignore-errors (revert-buffer t t))))))
map)))))
(add-hook 'lsp-mode-hook #'doom-modeline-update-lsp)
(add-hook 'lsp-after-uninitialized-hook #'doom-modeline-update-lsp)