From 2854d9f8d34575940e6cfcfc898d6a3e43639535 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 21 Mar 2015 19:17:01 -0700 Subject: [PATCH] Use file-truename when caching current file Closes #667 --- CHANGELOG.md | 3 +++ projectile.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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)