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
Make counsel-ag respect ivy-re-builder-alist #1935
Conversation
Thanks for working on this!
As I mentioned in the linked issue, I don't think we should remove |
- remove shell code from defcustom - simplify version checking - remove predicate suffix from variables - re-add caller to counsel-ag
Thank you for your review @basil-conto. I have pushed another commit based on your feedback. I did not change the wrappers around |
c82a014
to
e47d1ce
Compare
I was thinking about this some more, and I feel that I made it more complicated then it needed to be. I removed the custom variable and instead just check if rg doesn't produce an error when we use that flag. If accepts that flag, we assume that it works. Let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@abo-abo I now have a CA from gnu.org. If that was the hold up for merging this. |
Merged, thanks. Please review my follow up commit with new added tests. I had to research what negative lookaheads were, since I didn't use them before. With the added tests, hopefully it should be more clear. |
Just a note for anyone using If you have this problem, I suggest switching to another regexp builder for (setf (alist-get 'counsel-ag ivy-re-builders-alist)
#'ivy--regex-plus) |
@dsedivec, note that |
closes #1342.
counsel-ag
nor its derivatives support out of order matching, even though the underlying programs do. This means builders likeivy--regex-ignore-order
orivy--regex-plus
are essentially ignored. I took the liberty of enabling out of order matching for the searchers that support it. This is one of the killer features ofhelm-ag
IMHO. This will respectivy-re-builder-alist
.The only corner case for this is
rg
which did not add support for look-around's till0.10.0
which was released Sep 2018. I implemented a solution to automatically handle the version checking, but if that seems too heavy handed I can remove it. Instead we could just define a custom variable likecounsel-rg-look-around-enabled-p
. However that would mean it would not work out of the box anymore.Last thing I changed that may be up for debate is I removed the
:caller
options fromcounsel-ag
. See #1934 for more details. I think this is the right call, because now you can set a different re-builder for each type of searcher, which was impossible before. If you still want to match allcounsel-ag
related functions, you can set the key to the collection (counsel-ag-function
).