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

Add keys to counsel-grep #1711

Closed
wants to merge 1 commit into from

Conversation

@walseb
Copy link
Contributor

commented Aug 9, 2018

Counsel-grep is useful when browsing large files or when using old systems, but it's really irritating that you can't replace with counsel-grep like you can with swiper, forcing you to either bind a key for the replace command or start up swiper everytime you wan't to replace something. This fixes that problem and adds a few more keys for both counsel-grep and counsel-ag.

@walseb walseb changed the title Added keys to counsel-grep and counsel-ag Add keys to counsel-grep and counsel-ag Aug 9, 2018

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Aug 9, 2018

Thanks, I didn't even realise I missed ivy-call-and-recenter during counsel-grep, and was completely unaware of swiper-query-replace.

swiper-avy, however, is a bit problematic here, and I'm not sure whether avy, swiper, or counsel-grep is to blame:

  1. make plain
  2. C-xC-fswiper.elRET
  3. M-xcounsel-grepRETswiper
  4. C-'
    • Avy character sequences are displayed between line number digits:
      scrot0
  5. g
    • Now point is on line 48.
  6. Repeat steps 3 and 4.
  7. ld
    • Expected result: point on line 50, in the docstring of swiper-match-face-2.
    • Actual result: point remains on line 48, inside the name of swiper-match-face-2.

This may or may not be related to #1541.

@walseb walseb changed the title Add keys to counsel-grep and counsel-ag Add keys to counsel-grep Aug 10, 2018

@abo-abo abo-abo closed this in 2fcde41 Aug 10, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Aug 10, 2018

Thanks.

@walseb

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2018

@basil-conto Yeah, I have the same problem on my end and the problem is present with counsel-ag. I think the problem is that the keys are still corresponding to what they are bound to when you scroll to the top. Although your result here seem to contradict that, you should end up on line 1 at step 7, like in the issue you linked (and like what happened when I did those steps, although I wasn't using emacs -q).

Thanks for the merge though @abo-abo but I forgot to edit the commit message to remove the mention of "counsel-git-grep" since I removed my edits of that. If you want to you can do that.

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Aug 10, 2018

@abo-abo Would you like me to report the misplaced swiper-avy sequences as a separate issue?

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Aug 10, 2018

@walseb

you should end up on line 1 at step 7, like in the issue you linked

Step 6 results in new avy sequences, where ld is no longer assigned to line 1:

scrot1

Perhaps it is because line 1 is no longer in view that ld, which was previously assigned to it, doesn't take you there.

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Aug 10, 2018

Would you like me to report the misplaced swiper-avy sequences as a separate issue?

Yes, please. The fix should be quite simple, swiper-avy just relies that the cands start with a single space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.