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.
This commit is contained in:
Vincent Zhang 2019-04-10 14:05:31 +08:00
parent a6814ac4e3
commit a4ff475a11

View file

@ -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)))