File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1166,9 +1166,15 @@ The cache is created both in memory and on the hard drive."
11661166 (unless (or (projectile-file-cached-p current-file current-project)
11671167 (projectile-ignored-directory-p (file-name-directory abs-current-file))
11681168 (projectile-ignored-file-p abs-current-file))
1169- (let ((project-files (cons current-file (gethash current-project projectile-projects-cache))))
1169+ (let ((project-files (cons current-file (gethash current-project projectile-projects-cache)))
1170+ (cache-file (projectile-project-cache-file current-project)))
11701171 (puthash current-project project-files projectile-projects-cache)
1171- (projectile-serialize project-files (projectile-project-cache-file current-project)))
1172+ ; ; we serialize the cache with an idle time to avoid freezing the UI
1173+ ; ; immediately after the new file was created
1174+ (run-with-idle-timer
1175+ 30
1176+ nil
1177+ 'projectile-serialize project-files cache-file))
11721178 (message " File %s added to project %s cache. "
11731179 (propertize current-file 'face 'font-lock-keyword-face )
11741180 (propertize current-project 'face 'font-lock-keyword-face )))))))
You can’t perform that action at this time.
0 commit comments