Clear project-root cache before switching project
Fixes #3205 May address #3166
This commit is contained in:
parent
a4b4ea67eb
commit
2d4b946e03
1 changed files with 8 additions and 1 deletions
|
@ -46,9 +46,16 @@ Emacs.")
|
||||||
;; In case the user saves the file to a new location
|
;; In case the user saves the file to a new location
|
||||||
after-save-hook
|
after-save-hook
|
||||||
;; ...or makes external changes then returns to Emacs
|
;; ...or makes external changes then returns to Emacs
|
||||||
focus-in-hook)
|
focus-in-hook
|
||||||
|
;; ...or when we change the current project!
|
||||||
|
projectile-after-switch-project-hook)
|
||||||
projectile-project-root (if default-directory (doom-project-root)))
|
projectile-project-root (if default-directory (doom-project-root)))
|
||||||
|
|
||||||
|
;; However, it may become a problem when switching projects, so remove the
|
||||||
|
;; cached value when switching projects.
|
||||||
|
(setq-hook! 'projectile-before-switch-project-hook
|
||||||
|
projectile-project-root nil)
|
||||||
|
|
||||||
;; Projectile runs four functions to determine the root (in this order):
|
;; Projectile runs four functions to determine the root (in this order):
|
||||||
;;
|
;;
|
||||||
;; + `projectile-root-local' -> checks the `projectile-project-root' variable
|
;; + `projectile-root-local' -> checks the `projectile-project-root' variable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue