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

Fuzzy match should be non-greedy #79

Open
astoff opened this issue Jan 15, 2021 · 2 comments
Open

Fuzzy match should be non-greedy #79

astoff opened this issue Jan 15, 2021 · 2 comments

Comments

@astoff
Copy link

astoff commented Jan 15, 2021

So, for instance, the below example should have two matches on the same line, define-minor-mo and de ctrlf-local-mo. The shorter matches allow a more fine-grained movement, and greediness doesn't work well in files with long lines.

image

PS: Since this package is all about being sensible, couldn't the CRTLF prompt be replaced by something non-ugly, like Search? Also, I find that little arrow a bit gimmicky. I never forget what direction I was searching, unless I go for lunch in the middle of a search. I do sometimes loose track of whether I'm below or above the search starting point, though, which is what I initially thought the arrow was telling me.

@raxod502
Copy link
Member

Yes, replacing .* with .*? in the greedy regexp builder should be safe and sensible, as you suggested.

I have no objection to making the prompt appearance customizable. I, in my personal configuration, would like to keep it as is, but there is no reason that everyone needs to see the same thing. Perhaps we could do something like mode-line-format, where it is a list of strings and/or symbols, like:

(setq ctrlf-prompt-format '("CTRLF " search-direction " " search-style ": "))

@astoff
Copy link
Author

astoff commented Jan 17, 2021

That's a neat idea, the mode-line-format-style prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants