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

Case-insensitive search and configurable default search mode #1410

Open
0x5c opened this issue Jan 14, 2024 · 3 comments
Open

Case-insensitive search and configurable default search mode #1410

0x5c opened this issue Jan 14, 2024 · 3 comments
Labels
enhancement New feature or request feature-request User requested features

Comments

@0x5c
Copy link
Contributor

0x5c commented Jan 14, 2024

Abstract

Implement a case-insensitive search, a config key to select the default search case-sensitivity, and a way to change the case-sensitivity while in the search mode.

As a bonus, a "smart-case" search (case-insensitive if the input is lowercase, case-sensitive if the input has an uppercase character) would be useful too.

Motivation

Contour is currently only able to do a case-sensitive search, which makes it significantly harder to find things where the case is not known.

Specification

I'm not sure about the details, if it should be a keybind action that changes the case-sensitivity, or a special sequence like the way vim does it (\c anywhere in the search string). This should probably require an indicator in the status bar.

It seems clear to me is that it should be switchable once already in the search mode, and not only be a separate keybind action that starts a -separate- case-insensitive search mode. It might still be useful to have a case-sensitive: true/false option on the SearchReverse action for people that want to have that, but it isn't my use-case.

@0x5c 0x5c added enhancement New feature or request feature-request User requested features labels Jan 14, 2024
@christianparpart
Copy link
Member

This sounds like a great idea, that goes along with my own pain of wanting to have that (from time to time) as well as regex search. Sorry for not having implemented it yet, but we'll make it happen and keep you posted here :-)

@Yaraslaut
Copy link
Member

So we need to have:

  • switchable search mode via \c inside search prompt that will make search case-insensitive
  • action to trigger search in case-insensitive mode, and \c in search prompt will be ignored
    Also I think that we need to show search mode status only if case-insensitive mode is enabled

@0x5c
Copy link
Contributor Author

0x5c commented Feb 11, 2024

action to trigger search in case-insensitive mode

Might be better to be able to set a default directly, and have a param on the keybind action to override the default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request User requested features
Projects
None yet
Development

No branches or pull requests

3 participants