Open thomcc opened 6 years ago
From IRC: Can you also put findHighlightedRanges
and _highlightSearchResults
in a separate file? You could provide a callback to create the nodes.
Also interesting possibility is we want fuzzy search: https://github.com/farzher/fuzzysort
Fuzzy search would be better without a doubt. It seemed to me like this was a necessary first step though, but I hadn't considered just using a library for it.
Should this be closed, since fuzzy searching has been implemented?
By tokenize I just mean allow searching "foo bar" to match "foo baz bar" and such, each word (split on \s+) is checked separately.
The more complex part of this is highlighting them, or really figuring out which parts to highlight. The end result behaves pretty well.