Use resolved, absolute paths in doom-project api

Ensures projectile caches files under the right key.
This commit is contained in:
Henrik Lissner 2019-03-28 18:29:50 -04:00
parent c0b00327c2
commit 803ca2863a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -82,10 +82,10 @@ Will resolve to the nearest project root above DIR. If no project can be found,
the search will be rooted from DIR." the search will be rooted from DIR."
(unless (file-directory-p dir) (unless (file-directory-p dir)
(error "Directory %S does not exist" dir)) (error "Directory %S does not exist" dir))
(let* ((default-directory dir) (let* ((default-directory (file-truename (expand-file-name dir)))
(projectile-project-root (projectile-project-root
(or (projectile-project-root) (or (projectile-project-root)
dir))) default-directory)))
(call-interactively (call-interactively
;; Intentionally avoid `helm-projectile-find-file', because it runs ;; Intentionally avoid `helm-projectile-find-file', because it runs
;; asynchronously, and thus doesn't see the lexical `default-directory' ;; asynchronously, and thus doesn't see the lexical `default-directory'
@ -96,7 +96,7 @@ the search will be rooted from DIR."
;;;###autoload ;;;###autoload
(defun doom-project-browse (dir) (defun doom-project-browse (dir)
"Traverse a file structure starting linearly from DIR." "Traverse a file structure starting linearly from DIR."
(let ((default-directory (file-truename dir))) (let ((default-directory (file-truename (expand-file-name dir))))
(call-interactively (call-interactively
(cond ((featurep! :completion ivy) (cond ((featurep! :completion ivy)
#'counsel-find-file) #'counsel-find-file)