diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 21c0675..1089f91 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -289,6 +289,14 @@ mouse-1: Previous buffer\nmouse-3: Next buffer" (advice-add #'undo-tree-redo-1 :after #'doom-modeline-update-buffer-file-name) (advice-add #'symbol-overlay-rename :after #'doom-modeline-update-buffer-file-name) +(with-no-warnings + (if (boundp 'after-focus-change-function) + (add-function :after after-focus-change-function + (lambda () + (if (frame-focus-state) + (doom-modeline-update-buffer-file-name)))) + (add-hook 'focus-in-hook #'doom-modeline-update-buffer-file-name))) + (when (>= emacs-major-version 26) (add-variable-watcher 'doom-modeline-buffer-file-name-style