ui/doom-dashboard: fix dashboard not updating pwd on kill-buffer

This commit is contained in:
Henrik Lissner 2018-02-01 01:24:19 -05:00
parent 32754a6d07
commit 2ab0072d83
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -161,14 +161,14 @@ project (which may be different across perspective)."
(defun +doom-dashboard-update-pwd (&optional pwd) (defun +doom-dashboard-update-pwd (&optional pwd)
"Update `default-directory' in the Doom dashboard buffer. What it is set to is "Update `default-directory' in the Doom dashboard buffer. What it is set to is
controlled by `+doom-dashboard-pwd-policy'." controlled by `+doom-dashboard-pwd-policy'."
(with-current-buffer (doom-fallback-buffer) (if pwd
(if pwd (with-current-buffer (doom-fallback-buffer)
(setq-local default-directory pwd) (setq-local default-directory pwd))
(let ((new-pwd (+doom-dashboard--get-pwd))) (let ((new-pwd (+doom-dashboard--get-pwd)))
(when (and new-pwd (file-directory-p new-pwd)) (when (and new-pwd (file-directory-p new-pwd))
(unless (string-suffix-p "/" new-pwd) (unless (string-suffix-p "/" new-pwd)
(setq new-pwd (concat new-pwd "/"))) (setq new-pwd (concat new-pwd "/")))
(setq-local default-directory new-pwd)))))) (+doom-dashboard-update-pwd new-pwd)))))
(defun +doom-dashboard-reload (&optional force) (defun +doom-dashboard-reload (&optional force)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)." "Update the DOOM scratch buffer (or create it, if it doesn't exist)."