Skip to content

Commit

Permalink
refactor: format-buffer-file-truename.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Oct 23, 2023
1 parent f06950b commit 2861d11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doom-modeline-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -1423,15 +1423,15 @@ Return `default-directory' if no project was found."
(or (doom-modeline--project-root) default-directory))

(defun doom-modeline--format-buffer-file-name ()
"Format `buffer-file-name'."
"Get and format the buffer file name."
(let ((buffer-file-name (file-local-name
(or (buffer-file-name (buffer-base-buffer)) ""))))
(or (and doom-modeline-buffer-file-name-function
(funcall doom-modeline-buffer-file-name-function buffer-file-name))
buffer-file-name)))

(defun doom-modeline--format-buffer-file-truename ()
"Format `buffer-file-truename'."
(defun doom-modeline--format-buffer-file-truename (buffer-file-name)
"Get and format buffer file truename' via BUFFER-FILE-NAME."
(let ((buffer-file-truename (file-local-name
(or (file-truename buffer-file-name) ""))))
(or (and doom-modeline-buffer-file-truename-function
Expand All @@ -1441,7 +1441,7 @@ Return `default-directory' if no project was found."
(defun doom-modeline-buffer-file-name ()
"Propertize file name based on `doom-modeline-buffer-file-name-style'."
(let* ((buffer-file-name (doom-modeline--format-buffer-file-name))
(buffer-file-truename (doom-modeline--format-buffer-file-truename))
(buffer-file-truename (doom-modeline--format-buffer-file-truename buffer-file-name))
(file-name
(pcase doom-modeline-buffer-file-name-style
('auto
Expand Down

0 comments on commit 2861d11

Please sign in to comment.