From c69ec1e5c556a5cbbd4b47abc824e6180227e91a Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 4 Mar 2019 23:38:33 +0700 Subject: [PATCH] Fix incorrect faces of buffer file name. See https://github.com/seagle0128/doom-modeline/issues/114#issuecomment-469060334. --- doom-modeline-segments.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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