Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Highlight the wrong parts while searching in the command palette? #304

Closed
guilhermeleobas opened this issue Mar 20, 2017 · 7 comments
Closed

Comments

@guilhermeleobas
Copy link

image

"Open" keyword should be highlighted.

@Bretley
Copy link
Contributor

Bretley commented Mar 20, 2017 via email

@keforbes
Copy link
Collaborator

It's an issue with the search algorithm. It's looking at the entire path and removing a character from the search string as it finds a match. You can see it highlighted o, p, e in the path and by the time it got to the filename it only had n left in the search string.

I don't know if we need to search the filename first or allow for characters in the search string to happen multiple times. I've been giving this some thought but I don't have a good solution yet.

@Bretley
Copy link
Contributor

Bretley commented Mar 20, 2017 via email

@bryphe
Copy link
Member

bryphe commented Mar 20, 2017

Yep, the algorithm is a bit busted. Most of this happens in browser\src\UI\Reducer.ts in fuzzyMatchCharacters.

@bryphe
Copy link
Member

bryphe commented Mar 20, 2017

Might be worth replacing the algorithm we're using with a library like fuzzy.

@bryphe
Copy link
Member

bryphe commented Mar 20, 2017

This library also looked interesting: http://fusejs.io/

@keforbes
Copy link
Collaborator

Created #306 using fuse.js.

@bryphe bryphe closed this as completed in 0b887f4 Mar 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants