From 61ae177759a3f765999989395a21c38f79dc64db Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 12 Nov 2019 21:21:17 +0800 Subject: [PATCH] Refactor. --- doom-modeline-segments.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 30e7614..3fb61bd 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -372,8 +372,8 @@ mouse-1: Previous buffer\nmouse-3: Next buffer" (setq doom-modeline-buffer-file-name-style val) (dolist (buf (buffer-list)) (with-current-buffer buf - (if buffer-file-name - (doom-modeline-update-buffer-file-name)))))))) + (when buffer-file-name + (doom-modeline-update-buffer-file-name)))))))) ;; Optimize: just update the face of the buffer name in `after-change-functions', since ;; `doom-modeline--buffer-file-name' may consume lots of CPU if it's called too frequently.