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

counsel-rg's extra arguments do not support additional paths to search from #1498

Closed
rieje opened this issue Mar 21, 2018 · 6 comments
Closed

Comments

@rieje
Copy link

rieje commented Mar 21, 2018

According to man rg, any paths as the last arguments to the command are paths to search from. However, using the universal argument C-u counsel-rg to prompt counsel-rg for extra arguments and specifying a path as an argument will result in counsel-rg not showing results from this path and from the initial/default path, so the search results will always have nothing.

Example: C-u counsel-rg, enter ~/bin as initial directory to search for, enter ~/.emacs.d as an argument when prompted, and any string you search will return 0 results even if that string is in ~/bin.

Saw this issue posted on /r/emacs, so might as well submit a GH issue.

@abo-abo
Copy link
Owner

abo-abo commented Mar 22, 2018

Thanks for the report. Could you add the full command line that does what you want with ~/bin?

@rieje
Copy link
Author

rieje commented Mar 22, 2018

Yes, it's very simple: rg bash ~/bin ~/documentation (rg <pattern> [path...]). Based on what I've found, the order of the paths don't matter as specifying any path as an extra argument in addition to counsel-rg's initial path will not yield any results.

@abo-abo
Copy link
Owner

abo-abo commented Jul 5, 2018

OK, here's how I made it work (no code changes needed):

  • enter ~/bin as the initial dir as you do already
  • enter -- ~/.emacs.d as the extra args

Let me know if it works for you.

@abo-abo
Copy link
Owner

abo-abo commented Jul 5, 2018

Note the space before --.

@rieje
Copy link
Author

rieje commented Jul 6, 2018

Thanks, that works for me. Glad you mentioned the space before --, Github didn't show that. On reddit, you linked the related issue--I'm guessing that PR will solve this issue of needing to put a space before -- or remove the need for using -- altogether? You can decide whether to close this issue.

@abo-abo
Copy link
Owner

abo-abo commented Jul 9, 2018

Thanks, fixed. The extra initial space is no longer needed.

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

2 participants