mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Fix #29: Handle project root is nil.
Exception: (wrong-type-argument stringp nil)
This commit is contained in:
parent
f7a573906d
commit
92b5bf5c79
1 changed files with 4 additions and 4 deletions
|
@ -402,7 +402,7 @@ active.")
|
|||
(defun doom-modeline-update-env ()
|
||||
"Update environment info on mode-line."
|
||||
(when doom-modeline-env-command
|
||||
(let* ((default-directory (doom-modeline-project-root))
|
||||
(let ((default-directory (or (doom-modeline-project-root) ""))
|
||||
(s (shell-command-to-string doom-modeline-env-command)))
|
||||
(setq doom-modeline-env-version (if (string-match "[ \t\n\r]+\\'" s)
|
||||
(replace-match "" t t s)
|
||||
|
@ -530,8 +530,8 @@ 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 (or project-root "")
|
||||
(let* ((project-root (or (doom-modeline-project-root) ""))
|
||||
(file-name-split (shrink-path-file-mixed project-root
|
||||
(file-name-directory file-path)
|
||||
file-path))
|
||||
(active (doom-modeline--active)))
|
||||
|
|
Loading…
Reference in a new issue