Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2nd project change doesn't work #167

Open
kkatsuyuki opened this issue Sep 3, 2022 · 1 comment
Open

2nd project change doesn't work #167

kkatsuyuki opened this issue Sep 3, 2022 · 1 comment

Comments

@kkatsuyuki
Copy link

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

  • helm-projectile version: 20220820.826
  • helm version (in helm-pkg.el): 20210520.1523
  • projectile version (M-x projectile-version): 20210503.738
  • Emacs version (M-x emacs-version): 27.2
  • OS: Arch Linux
@kkatsuyuki
Copy link
Author

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

I investigated the issue.

  • helm-source-projectile-files-list collects candidates under with-helm-current-buffer
  • projectile-switch-project-by-name in projectile.el change default-directory to the project to switch, and then switches projects (= do helm-projectile in this case) under with-temp-buffer
  • helm-current-buffer isn't set a temporary buffer, so helm-projectile invoked from projectile-switch-project-by-name doesn't update helm-current-buffer.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant