bbatsov / helm-projectile

Helm UI for Projectile
329 stars 71 forks source link

2nd project change doesn't work #167

Open kkatsuyuki opened 2 years ago

kkatsuyuki commented 2 years ago

Expected behavior

When projectile-switch-project-action is helm-projectile, helm-projectile should show project contents on 2nd and later project changes.

Actual behavior

helm-projectile shows project contents on first project change, but it doesn't update the contents on 2nd and later project changes.

Steps to reproduce the problem

When load-path is set correctly, do

(setq projectile-switch-project-action 'helm-projectile)
(require 'helm-projectile)
(projectile-discover-projects-in-directory "~/directory/to/projects/")

Do helm-projectile, change project to "project1", and change project to "project2". "Project files" still shows files in "project1".

Environment & version information

kkatsuyuki commented 2 years ago

I reproduced the problem with helm-projectile ver. 20220820.826, helm ver.20220917.1817, and projectile ver.20220828.1421.

I investigated the issue.

As a result, helm-source-projectile-files-list collects candidates in the old directory after second project change.

I'm going to change with-helm-current-buffer to with-temp-buffer + (hack-dir-local-variables-non-file-buffer) in helm-source-projectile-files-list. Are there any problems with this change?