Fix: error while truncate the file without directory information.

Happen while editing org src code blocks. (:file test.py)
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-exists-p(nil)
  f-exists\?(nil)
  f-same\?(nil "")
  shrink-path-file-mixed("" nil "test.py")
  doom-modeline--buffer-file-name("test.py" "/Users/xxx/org/test.py" shrink)
  doom-modeline-buffer-file-name()
This commit is contained in:
Vincent Zhang 2018-11-10 17:25:13 +08:00
parent fd5c985dc0
commit 2812b1990f

View file

@ -556,7 +556,7 @@ Example:
~/Projects/FOSS/emacs/lisp/comint.el => ~/P/F/emacs/lisp/comint.el" ~/Projects/FOSS/emacs/lisp/comint.el => ~/P/F/emacs/lisp/comint.el"
(let* ((project-root (or (doom-modeline-project-root) "")) (let* ((project-root (or (doom-modeline-project-root) ""))
(file-name-split (shrink-path-file-mixed project-root (file-name-split (shrink-path-file-mixed project-root
(file-name-directory file-path) (or (file-name-directory file-path) "./")
file-path)) file-path))
(active (doom-modeline--active))) (active (doom-modeline--active)))
(if (null file-name-split) (if (null file-name-split)