diff --git a/CHANGELOG.md b/CHANGELOG.md index 69061cb4f..78cf91014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ to behave like `helm-find-files`, such as multifile selection and opening or del buffers by name * New `defcustom` `projectile-globally-ignored-file-suffixes` allows you to globally ignore files with particular extensions +* Use file-truename when caching filenames to prevent + duplicate/symlinked filepaths from appearing when opening a project + file, ### Changes diff --git a/projectile.el b/projectile.el index 8e506349d..a81d52a96 100644 --- a/projectile.el +++ b/projectile.el @@ -548,7 +548,7 @@ The cache is created both in memory and on the hard drive." "Add the currently visited file to the cache." (interactive) (let* ((current-project (projectile-project-root)) - (abs-current-file (buffer-file-name (current-buffer))) + (abs-current-file (file-truename (buffer-file-name (current-buffer)))) (current-file (file-relative-name abs-current-file current-project))) (when (gethash (projectile-project-root) projectile-projects-cache) (unless (or (projectile-file-cached-p current-file current-project)