 project root). Excludes the file basename. See `doom-buffer-name' for that."
   (when buffer-file-name
     (let ((buffer-path
-           (file-relative-name (file-name-directory buffer-file-truename)
+           (file-relative-name (file-name-directory
+                                (or buffer-file-truename (file-truename buffer-file-name)))
                                (doom-project-root))))
       (unless (equal buffer-path "./")
         (let ((max-length (truncate (* (window-body-width) 0.4))))

;;; ui/doom-modeline/config.el

(line-number-mode -1)


(defun +doom-modeline--buffer-file ()
  "Display the base of the current buffer's filename."
  (if buffer-file-name
      (file-name-nondirectory (or buffer-file-truename (file-truename buffer-file-name)))
    "%b"))

(defun +doom-modeline--buffer-path ()
