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

helm-source-projectile-buffer omits first (the current) buffer from the list of buffers #160

Open
dvdkhlng opened this issue Feb 22, 2022 · 0 comments

Comments

@dvdkhlng
Copy link

Expected behavior

Running helm-projectile, I expected all project buffers to be shown, because I wanted to select them all to run a multi-file replace.

Actual behavior

helm-projectile (and also helm-projectile-switch-to-buffer) omits the current buffer from the list. This may make sense when switching buffers, but it makes it impossible to select all of the project's currently opened files for stuff like bulk search&replace.

The questionable code in question is:

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

Steps to reproduce the problem

M-x helm-projectile

Environment & version information

  • helm-projectile version: 1.0.0
  • helm version (in helm-pkg.el): 3.5.6
  • projectile version (M-x projectile-version): 2.5.0
  • Emacs version (M-x emacs-version): 26.3
  • OS: Ubuntu

Workaround

The following workaround is unclean and has many unwanted side-effects but it seems to fix the problem in question for me:

(defadvice projectile-project-buffer-names (after helm-projectile-patch-dummy
                                                  activate)
  "Ugly fix.
`helm-source-projectile-buffer' does `cdr' on
`projectile-project-buffer-names'.  Undo that here.
Unfortunately this will interfere with other projectile
functionns?"
  (setq ad-return-value (cons "*scratch*" ad-return-value)))
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