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

Strict case-sensitive search in counsel-*g when case-folding is off #1869

Closed
vishesh opened this issue Dec 21, 2018 · 4 comments
Closed

Strict case-sensitive search in counsel-*g when case-folding is off #1869

vishesh opened this issue Dec 21, 2018 · 4 comments

Comments

@vishesh
Copy link

@vishesh vishesh commented Dec 21, 2018

When I turn off case-folding in counsel-*g functions, it still gives treats the query term as case folded. Turning off case-folding is necessary when you want to do case-sensitive query on is all lower case term.

@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented Dec 21, 2018

Functions such as counsel-ag and counsel-rg delegate the search logic to their corresponding tools ag and rg. You can customise the corresponding command either statically via counsel-ag-base-command, counsel-rg-base-command, etc., or dynamically by interactively specifying flags such as --case-sensitive (see #1408 and #1559).

See also #1542.

@vishesh
Copy link
Author

@vishesh vishesh commented Dec 21, 2018

Thanks for the response. Dynamically changing the base-command was I was thinking as well. I however, wanted to bring it here, because as a user I felt like the behavior of turning on/off case-folding should work same out-of-box across the commands provided by this package. It was a bit confusing when it worked for swiper but not for counsel-rg.

I understand however, it brings other problems since the command used by ag/rg is in general configurable and if user changes it, it may break this anyway. In that case, I would be happy to create a wiki to document whatever hack I do to get it working.

@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented Dec 21, 2018

I would be happy to create a wiki to document whatever hack I do to get it working

Please do, regardless of any other outcomes of this issue.

@abo-abo abo-abo closed this in b49f17f May 8, 2019
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented May 8, 2019

Thanks, please test. I checked that ag, rg and ack all have the same -i flag to ignore case.

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
Make sure your `counsel-ag-base-command' or `counsel-rg-base-command'
doesn't include " -i ": it will be added autmatically based on your
input and `ivy-case-fold-search'.

Fixes abo-abo#1869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants