Skip to content

Commit

Permalink
invalidate projectile cache on delete and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
d12frosted authored and syl20bnr committed Jun 3, 2016
1 parent 5c1f56f commit 0a973c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layers/+distribution/spacemacs-base/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ projectile cache when it's possible and update recentf list."
(when (fboundp 'recentf-add-file)
(recentf-add-file new-name)
(recentf-remove-if-non-kept filename))
(when (and (configuration-layer/package-usedp 'projectile)
(projectile-project-p))
(call-interactively #'projectile-invalidate-cache))
(message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name))))))))

(defun spacemacs/delete-file (filename &optional ask-user)
Expand Down Expand Up @@ -363,6 +366,9 @@ removal."
(when (yes-or-no-p "Are you sure you want to delete this file? ")
(delete-file filename t)
(kill-buffer buffer)
(when (and (configuration-layer/package-usedp 'projectile)
(projectile-project-p))
(call-interactively #'projectile-invalidate-cache))
(message "File '%s' successfully removed" filename)))))

;; from magnars
Expand Down

0 comments on commit 0a973c0

Please sign in to comment.