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

feat: add smartcase support like vim #2060

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

phanen
Copy link

@phanen phanen commented Dec 23, 2024

"smartcase": case sensitive if all chars in current query are in lowercase, otherwise it's case insensitive

I notice that there are two flags now:

  • -case-sensitive by rofi globally
  • -i used in rofi -dmenu mode
  • So by default rofi is case insensitive, but case sensitive in rofi -dmenu mode.

This PR implement:

  • Always use smart case by default like what fzf does (both in rofi and rofi -dmenu).
  • To opt-out this behavior, users can still use -case-sensitive and -i.

@DaveDavenport
Copy link
Collaborator

Interesting patch, thanks!

@phanen phanen force-pushed the feat/smartcase branch 3 times, most recently from 4509ca2 to 2093605 Compare December 24, 2024 12:37
@phanen phanen changed the title WIP: feat: add smartcase support like vim feat: add smartcase support like vim Dec 24, 2024
@phanen phanen marked this pull request as ready for review December 24, 2024 12:38
@DaveDavenport DaveDavenport added this to the 1.7.7 milestone Dec 26, 2024
@DaveDavenport
Copy link
Collaborator

If I understand the code correctly, this changes the default behaviour? It would be good (to avoid users annoyance) to keep the existing behaviour and add this as an extra option.

@DaveDavenport DaveDavenport modified the milestones: 1.7.7, 1.7.8 Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants