Open nordlow opened 4 years ago
I don't intensively search for regexps in ivy/swiper so am not sure whether it's standard to backquote curly braces. In any case I think counsel-projectile probably doesn't play any part in this because counsel-projectile-rg
essentially relies on counsel-rg
. You could confirm this by trying your search in counsel-rg
.
The difference between counsel-rg
and swiper-isearch
could come from the way rg
processes the regexp it receives from counsel-rg
I imagine. Whether or not this is something that counsel-rg
should address I don't know. I would suggest to submit the issue on the swiper repo.
I want to search for a regexp where the whitespace also includes newlines, in my case, to find C-style
if
-expressions that have an opening brace after the close parenthesis likeThe command
swiper-isearch
understands\n
in its minibuffer input and can match such multi-line patterns via for instanceif ( ) \n {
butcounsel-projectile-rg
can't with being fed the flag-U
. It would be great if it did.I guess this is related:
https://til.hashrocket.com/posts/9zneks2cbv-multiline-matches-with-ripgrep-rg
Update:
This call
rg -U 'if \(.*\) *\n *\{'
matches my needsand in Elisp
with minibuffer input
static if ( ) \n \{
works. Is it standard to have to backquote curly braces in Ivy/Projectile-style searches?It's not needed with Swiper so I guess we shouldn't need to do that here either for interface consistency.