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)