From 62f48c062ee02b2f07a7b19ed52496e9927b9c24 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 6 Jun 2019 18:20:18 +0800 Subject: [PATCH] Refresh the mode-line forcedly after switching frames. --- doom-modeline-core.el | 3 +++ doom-modeline-segments.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index 4de9853..9861107 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -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) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 51a2aef..f2bfac2 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -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)