From a22a895b7b954c05328375f0c26d4c42197e7dc5 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 24 Sep 2018 22:38:01 +0800 Subject: [PATCH] Fix: invalid shrinked file path when the file is not in a project. Refer to https://emacs-china.org/t/doom-modeline-doom-emacs-mode-line/6742/34?u=seagle0128. --- doom-modeline.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index aa4c198..3aaa222 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -525,7 +525,7 @@ fish-shell style. Example: ~/Projects/FOSS/emacs/lisp/comint.el => ~/P/F/emacs/lisp/comint.el" (let* ((project-root (doom-modeline-project-root)) - (file-name-split (shrink-path-file-mixed project-root + (file-name-split (shrink-path-file-mixed (or project-root "") (file-name-directory buffer-file-name) buffer-file-name)) (active (doom-modeline--active)))