Make file search case-insensitive #5224
Open
+12
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #3876 and #5219. Neither have a ton of conversation (the former being about a month old) but it seems like a very uncontroversial change.
Also added a test to show this behavior which will show it failing before. Test succeeeds. README was also updated to reflect this minor change. All
cargo
checks passed.What
Right now file search is set to be "smart" which means if you have any capitalizations anywhere else in your file search prompt you have to get perfect capitalization in your @ file search shortcut otherwise nothing is found.
Why
Getting capitalization right is irrelevant to file search and is contrary to how most other CLI and modern UX patterns work (Spotlight search on macOS). Currently if you type a prompt like:
That will not work as you started your search with a capitalization, so unless you perfectly capitalize "ContentView.s" it will not autocomplete. Also I not realize that the initial capitalization is what broke the search until I made this PR (which speaks to the behavior being not very discoverable).
I don't think starting the search with a capital for whatever reason should make you have to capitalize everything else in the rest of the search perfectly. Again see Spotlight on Mac, or any web browser (if I type
Chatg
it will still autocompletechatgpt.com
)How
Changes Nucleo's case matching: https://docs.rs/nucleo-matcher/latest/nucleo_matcher/pattern/enum.CaseMatching.html