From a4ff475a11b30f8f6944294b39607cbdfba8eae6 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 10 Apr 2019 14:05:31 +0800 Subject: [PATCH] Fix error while opening the special directory. The directory '.HFS+ Private Directory Data'$'\r' on macOS is special, and OS is unable to handle correctly. file-name-nondirectory returns empty always. --- doom-modeline-segments.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 25e8107..caedb5b 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -204,8 +204,7 @@ buffer where knowing the current project directory is important." (icon (if (and buffer-file-name (all-the-icons-match-to-alist buffer-file-name all-the-icons-icon-alist)) - (doom-modeline-icon-for-file (file-name-nondirectory buffer-file-name) - :height height) + (doom-modeline-icon-for-file buffer-file-name :height height) (doom-modeline-icon-for-mode major-mode :height height)))) (if (symbolp icon) (setq icon (doom-modeline-icon-faicon "file" :height height :v-adjust -0.0575)))