diff --git a/core/autoload/files.el b/core/autoload/files.el index c85d67e59..fea61b96e 100644 --- a/core/autoload/files.el +++ b/core/autoload/files.el @@ -89,7 +89,7 @@ MATCH is a string regexp. Only entries that match it will be included." (recentf-remove-if-non-kept old-path)) (when (and (bound-and-true-p projectile-mode) (projectile-project-p) - (projectile-file-cached-p old-path (projectile-project-root))) + (projectile-file-cached-p old-path (doom-project-root 'nocache))) (projectile-purge-file-from-cache old-path)) (when (bound-and-true-p save-place-mode) (save-place-forget-unreadable-files))) diff --git a/core/autoload/projects.el b/core/autoload/projects.el index e43f5af15..40267da90 100644 --- a/core/autoload/projects.el +++ b/core/autoload/projects.el @@ -62,7 +62,10 @@ If NOCACHE, don't fetch a cached answer." (if nocache (without-project-cache! (doom-project-root nil)) (let (projectile-require-project-root) - (projectile-project-root)))) + ;; NOTE `projectile-project-root' should return default-directory if we're + ;; not in a project. Seems to be a bug upstream. + (or (projectile-project-root) + default-directory)))) ;;;###autoload (defalias 'doom-project-expand #'projectile-expand-root) diff --git a/modules/feature/lookup/autoload/lookup.el b/modules/feature/lookup/autoload/lookup.el index 45f527c3c..b20e274bb 100644 --- a/modules/feature/lookup/autoload/lookup.el +++ b/modules/feature/lookup/autoload/lookup.el @@ -299,7 +299,7 @@ Otherwise, falls back on `find-file-at-point'." (let ((file (projectile-completing-read "Find file: " (projectile-current-project-files) :initial-input path))) - (find-file (expand-file-name file (projectile-project-root))) + (find-file (expand-file-name file (doom-project-root))) (run-hooks 'projectile-find-file-hook)))))) (#'doom-project-browse)))) (find-file-at-point path))))))