ui/doom-modeline: fix symlinked buffer-path hijinks

The modeline resolves a relative path to the current file in order to
display a short path string in the modeline. However, symlinks would
break this, resulting in paths like: ../../../../real/path/to/file.
This commit is contained in:
Henrik Lissner 2017-05-14 09:48:12 +02:00
parent 125fca09a0
commit af88423b35

View file

@ -249,7 +249,7 @@ active."
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-name)
(file-relative-name (file-name-directory buffer-file-truename)
(doom-project-root))))
(unless (equal buffer-path "./")
(let ((max-length (truncate (* (window-body-width) 0.4))))