mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Speed up project root detection by resolving it less often
Projectile can consume a lot of cycles, especially in indirect buffers or because of project-root-sensitive path segments in the modeline. This experimental fix should spare you that heartache.
This commit is contained in:
@ -40,6 +40,16 @@ Emacs.")
|
|||||||
|
|
||||||
:config
|
:config
|
||||||
(projectile-mode +1)
|
(projectile-mode +1)
|
||||||
|
|
||||||
|
;; REVIEW Resolve the project root once, when the file/buffer is opened. This
|
||||||
|
;; speeds up projectile's project root resolution by leaps, but does
|
||||||
|
;; put you at risk of having a stale project root.
|
||||||
|
(setq-hook! '(after-change-major-mode-hook
|
||||||
|
;; In case the user saves the file to a new location
|
||||||
|
after-save-hook
|
||||||
|
;; ...or makes external changes then returns to Emacs
|
||||||
|
focus-in-hook)
|
||||||
|
projectile-project-root (if default-directory (doom-project-root)))
|
||||||
|
|
||||||
;; Projectile runs four functions to determine the root (in this order):
|
;; Projectile runs four functions to determine the root (in this order):
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user