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

Allow running rg from Dired on root directory #71

Merged
merged 2 commits into from
Dec 30, 2019

Conversation

raxod502
Copy link
Contributor

Previously if you opened a Dired buffer to the root directory of your filesystem and attempted to use rg, rg-project-root would get a nil value for FILE. All of the backends would fail to provide a project root, so rg-project-root would fall back on asking for the directory that contains FILE. Unfortunately, in this case FILE is unset. The problem is solved by handling the cases where FILE is nil (or doesn't have a directory component), and defaulting to default-directory.

Previously if you opened a Dired buffer to the root directory of your
filesystem and attempted to use rg, rg-project-root would get a nil
value for FILE. All of the backends would fail to provide a project
root, so rg-project-root would fall back on asking for the directory
that contains FILE. Unfortunately, in this case FILE is unset. The
problem is solved by handling the cases where FILE is nil (or doesn't
have a directory component), and defaulting to default-directory.
@coveralls
Copy link

coveralls commented Dec 28, 2019

Coverage Status

Coverage decreased (-0.06%) to 83.564% when pulling 5da7d4d on raxod502:feat/rg-from-root-dired into af1ae55 on dajva:develop.

Copy link
Owner

@dajva dajva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr. Added a suggestion for making the logic more compact.

rg.el Outdated Show resolved Hide resolved
@dajva dajva merged commit 36ca9c2 into dajva:develop Dec 30, 2019
@dajva
Copy link
Owner

dajva commented Dec 30, 2019

Thanks

@raxod502 raxod502 deleted the feat/rg-from-root-dired branch January 9, 2020 18:07
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.

None yet

3 participants