From e075339b2b49bfb19fe14bf5b977e22eb060b61a Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 13 Nov 2018 23:23:57 +0800 Subject: [PATCH] Optimize performance. (benchmark-run 1000 (format-mode-line mode-line-format)) From ~2.5s to ~0.5s!!! --- doom-modeline.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 265eb06..664de69 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -521,8 +521,7 @@ active.") (and (doom-modeline--active) 'doom-modeline-buffer-file)))) (when face `(:inherit ,face)))))) - 'help-echo buffer-file-truename))) - (message "#####%s####" doom-modeline-buffer-file-name)) + 'help-echo buffer-file-truename)))) (add-hook 'find-file-hook #'doom-modeline-update-buffer-file-name) (add-hook 'after-save-hook #'doom-modeline-update-buffer-file-name) @@ -642,7 +641,7 @@ directory, the file name, and its state (modified, read-only or non-existent)." :face 'doom-modeline-warning :v-adjust -0.05) " "))) - (if doom-modeline-buffer-file-name + (if doom-modeline-buffer-file-name doom-modeline-buffer-file-name "%b")))