Fix #3004: stale root cache on project search

This commit is contained in:
Henrik Lissner 2020-04-30 19:01:10 -04:00
parent f7655de598
commit ba8892d7e9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 13 additions and 12 deletions

View file

@ -101,11 +101,10 @@ If DIR is not a project, it will be indexed (but not cached)."
(unless (file-readable-p dir)
(error "Directory %S isn't readable" dir))
(let* ((default-directory (file-truename (expand-file-name dir)))
(project-root (doom-project-root default-directory))
(projectile-project-root default-directory)
(projectile-project-root (doom-project-root default-directory))
(projectile-enable-caching projectile-enable-caching))
(cond ((and project-root (file-equal-p project-root projectile-project-root))
(unless (doom-project-p projectile-project-root)
(cond ((and projectile-project-root (file-equal-p projectile-project-root default-directory))
(unless (doom-project-p default-directory)
;; Disable caching if this is not a real project; caching
;; non-projects easily has the potential to inflate the projectile
;; cache beyond reason.