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

Fix file paths in projectile-replace* with prefix arg #1655

Merged

Conversation

bcc32
Copy link
Contributor

@bcc32 bcc32 commented Mar 4, 2021

When prefix arg is supplied and a directory is selected, the directory
passed to projectile-dir-files is not necessarily the project root, so
using projectile-expand-root yields incorrect behavior.

For example, in a project rooted at ~/project with files:

~/project/
~/project/Makefile
~/project/foo/bar.c

With C-u M-x projectile-replace-regexp, selecting directory ~/project/foo/, projectile incorrectly attempts to read file ~/project/bar.c, resulting in an error.


Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

When running eldev test, I see that two tests fail, but they also fail in master, so I don't think it has anything to do with this PR.

bcc32 added 2 commits March 4, 2021 18:13
When prefix arg is supplied and a directory is selected, the directory
passed to projectile-dir-files is not necessarily the project root, so
using projectile-expand-root yields incorrect behavior.
@bbatsov bbatsov merged commit 1528ed4 into bbatsov:master Mar 9, 2021
@bbatsov
Copy link
Owner

bbatsov commented Mar 9, 2021

The changes look good to me. Thanks!

@bcc32 bcc32 deleted the fix-projectile-replace-file-name-expansion branch March 9, 2021 18:03
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 this pull request may close these issues.

2 participants