Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow fuzzy searching in Quick Switch modal #204
I originally tried a more algorithmic approach of traversing both string to figure out if the
Related Issue: N/A
@dmlittle I like this. Is the same fuzzy behavior as text editors like Atom or Sublime implement? I know that IntelliJ has a slightly less fuzzy (more advanced?) matching algorithm.
It would also be good to see some tests around this. Currently, no code within React components is tested. You could extract the matching function into
As for the checkbox. It's probably fine to leave it out for now. We can add it if it becomes a problem. I just checked the analytics and less than 2% of users have used this feature.
@gschier I just took a quick look with Sublime and Atom and it's very similar with the exception that Atom also ignores whitespace (searching for
As for the sidebar, I think it makes sense to also add this functionality there.
Let me know what you think of the whitespace issue and I'll refactor the changes to extract the fuzzy functionality into a separate file where we can test it's functionality.
I'm not surprised many people don't know about this feature as I only learned about it while reading some of the source code. But now that I know it exists, I'll definitely be using it regularly.
The implementation you have now is probably good enough. Better to ship it now and improve it later, if needed.
Highlighting matches in the sidebar would be awesome but could probably be done afterwards (unless you're feeling ambitious). Similar behavior is already done in the autocomplete code if you want to take a look at that. (In
Currently filtering works if you either have a substring that is in a request name or if you provide a matching