-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
The results of `ag' don't have "./" prepended like `rg' has. Fixes #1841
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4123,7 +4123,10 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'." | |
highlight | ||
help-echo "mouse-1: call ivy-action") | ||
str) | ||
(insert (if (string-match-p "\\`.[/\\]" str) "" " ") | ||
(insert (if (or (string-match-p "\\`.[/\\]" str) | ||
(eq (ivy-state-caller ivy-last) 'counsel-ag)) | ||
"" | ||
" ") | ||
str ?\n)) | ||
(goto-char (point-min)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
m-renaud
|
||
(forward-line 4) | ||
|
1 comment
on commit be98b75
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.
@abo-abo Any chance this or
could be extended to include swiper
, swiper-many
, and swiper-all
? I think something like the following would work:
(or (string-match-p "\\`.[/\\]" str)
(eq (ivy-state-caller ivy-last) 'counsel-ag)
(eq (ivy-state-caller ivy-last) 'swiper)
(eq (ivy-state-caller ivy-last) 'swiper-many)
(eq (ivy-state-caller ivy-last) 'swiper-all))
Even better would be to provide a customization option where you could specify which source minibuffers you want to generate a wgrep compatible occur buffer for (for me it would be all of them).
This breaks the navigation in ivy-occur buffers from ag: the ./ prefix hack allows :
https://github.com/abo-abo/swiper/blob/master/ivy.el#L4280
Plus, we create a coupling with the different tool behaviour: what if rg changes the way results are displayed? sould we support multiple executable versions?
I think that the proper fix is to prepend ./ if not already there; we get