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

Remove current buffer from helm-projectile-switch-project #721

Closed
dsdshcym opened this issue Apr 21, 2015 · 9 comments · Fixed by #741
Closed

Remove current buffer from helm-projectile-switch-project #721

dsdshcym opened this issue Apr 21, 2015 · 9 comments · Fixed by #741

Comments

@dsdshcym
Copy link
Contributor

Every time I use helm-projectile-switch-project, I find that the current buffer is in the Project buffers section.

This behavior is really odd most of the time. Cause if I use helm-projectile-switch-project instead of helm-projectile-find-file, the current buffer is clearly not the file of the Project I want.

And I also find that the current buffer's path is changed to the chosen project path.

Like this:
screen shot 2015-04-20 at 14 43 44

But the original path of ics.org is:
screen shot 2015-04-20 at 14 46 15

(Original posted in syl20bnr/spacemacs#1275)

@bbatsov
Copy link
Owner

bbatsov commented May 9, 2015

//cc @tuhdo

@tuhdo
Copy link
Contributor

tuhdo commented May 9, 2015

Actually, helm-projectile-switch-project reuses (and thus, display) the same buffer list as projectile-switch-project. So, if you want to exclude it, simply cdr the current list.

@dsdshcym
Copy link
Contributor Author

@tuhdo I still don't understand.

I looked into projectile's source file. And I didn't find which list I should cdr.

@tuhdo
Copy link
Contributor

tuhdo commented May 11, 2015

@dsdshcym You can replace this line with this line:

(candidates :initform (cdr helm-buffers-list-cache))

@dsdshcym
Copy link
Contributor Author

@tuhdo Thank you!
I'm wondering why this is not default behavior. Are there some other concerns?

@tuhdo
Copy link
Contributor

tuhdo commented May 11, 2015

Probably no one notices it. You should make a PR.

dsdshcym added a commit to dsdshcym/projectile that referenced this issue May 11, 2015
dsdshcym added a commit to dsdshcym/projectile that referenced this issue May 11, 2015
@hlissner
Copy link
Contributor

This fix seemed to break helm-projectile-switch-to-buffer for me for some reason, causing it to yield an empty buffer list without any error.

Curiously, by doing the cdr earlier, on line 500 instead like so:

(setq helm-buffers-list-cache (cdr (projectile-project-buffer-names)))

The problem magically disappears (with the current buffer omitted from the list).

Anyone else getting this?

@tuhdo
Copy link
Contributor

tuhdo commented May 12, 2015

@hlissner yea I fixed it with this PR: #742

@hlissner
Copy link
Contributor

Awesome, thanks!

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

Successfully merging a pull request may close this issue.

4 participants