ui/doom-modeline: fix error caused by nil buffer-file-truename
This commit is contained in:
parent
da84850ced
commit
0be42fe473
1 changed files with 2 additions and 2 deletions
|
@ -245,13 +245,13 @@ If TRUNCATE-TAIL is t also truncate the parent directory of the file."
|
||||||
(if (null root)
|
(if (null root)
|
||||||
(propertize "%b" 'face (if active 'doom-modeline-buffer-file))
|
(propertize "%b" 'face (if active 'doom-modeline-buffer-file))
|
||||||
(let* ((modified-faces (if (buffer-modified-p) 'doom-modeline-buffer-modified))
|
(let* ((modified-faces (if (buffer-modified-p) 'doom-modeline-buffer-modified))
|
||||||
(relative-dirs (file-relative-name (file-name-directory buffer-file-truename)
|
(relative-dirs (file-relative-name (file-name-directory (file-truename buffer-file-name))
|
||||||
(if include-project (concat root "../") root)))
|
(if include-project (concat root "../") root)))
|
||||||
(relative-faces (or modified-faces (if active 'doom-modeline-buffer-path)))
|
(relative-faces (or modified-faces (if active 'doom-modeline-buffer-path)))
|
||||||
(file-faces (or modified-faces (if active 'doom-modeline-buffer-file))))
|
(file-faces (or modified-faces (if active 'doom-modeline-buffer-file))))
|
||||||
(if (equal "./" relative-dirs) (setq relative-dirs ""))
|
(if (equal "./" relative-dirs) (setq relative-dirs ""))
|
||||||
(concat (propertize relative-dirs 'face (if relative-faces `(:inherit ,relative-faces)))
|
(concat (propertize relative-dirs 'face (if relative-faces `(:inherit ,relative-faces)))
|
||||||
(propertize (file-name-nondirectory buffer-file-truename)
|
(propertize (file-name-nondirectory (file-truename buffer-file-name))
|
||||||
'face (if file-faces `(:inherit ,file-faces))))))))
|
'face (if file-faces `(:inherit ,file-faces))))))))
|
||||||
|
|
||||||
(defun +doom-modeline--buffer-file-name (truncate-project-root-parent)
|
(defun +doom-modeline--buffer-file-name (truncate-project-root-parent)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue