Fix :mv/:rm/:cp error when projectile-mode is off

This commit is contained in:
Henrik Lissner 2017-06-28 15:17:47 +02:00
parent b3a9889c53
commit 25dca5fde7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -2,11 +2,12 @@
(defun +evil--forget-file (old-path &optional new-path) (defun +evil--forget-file (old-path &optional new-path)
"Ensure `recentf', `projectile' and `save-place' forget OLD-PATH." "Ensure `recentf', `projectile' and `save-place' forget OLD-PATH."
(when (fboundp 'recentf-add-file) (when (bound-and-true-p recentf-mode)
(when new-path (when new-path
(recentf-add-file new-path)) (recentf-add-file new-path))
(recentf-remove-if-non-kept old-path)) (recentf-remove-if-non-kept old-path))
(when (and (projectile-project-p) (when (and projectile-mode
(projectile-project-p)
(projectile-file-cached-p old-path (projectile-project-root))) (projectile-file-cached-p old-path (projectile-project-root)))
(projectile-purge-file-from-cache old-path)) (projectile-purge-file-from-cache old-path))
(when (bound-and-true-p save-place-mode) (when (bound-and-true-p save-place-mode)