sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
807 stars 39 forks source link

Prevent search terms to have overlap in fuzzy matching #3344

Open gwenzek opened 4 years ago

gwenzek commented 4 years ago

Problem description

If you search command palette for pack remov package then the current results are:

As you can see the pack and package search term both match the same part of the target command.

Preferred solution

I think it'd be more natural if the results was showing only one of:

Here pack and package are matched to non overlapping part of the command (order isn't important for me, since that's why I use search term)

Alternatives

Maybe those should be allowed to, but with lower ranking since they have a smaller match:

Additional Information (optional)

Note that searching for pack removpackage returns the desired results, but I've grown generous with spaces since they have been introduced because they generally provide more matches. (Is it File: rename or Rename File ?

TerminalFi commented 4 years ago

Interesting catch, for a visual example, even spelling out the exact match.

image
michaelblyons commented 4 years ago

This typically gets me when I paste .sublime-syntax content to a new window, and the YAML first-line-match set the syntax to YAML. The next thing I try to do is Cmd+Shift+P syn sub syn, looking for PackageDev's "Set Syntax: Sublime Text Syntax Definition (YAML)" but what I get is

Screen Shot 2020-05-16 at 10 45 22 PM

with the desired result waaaaay down there below the cutoff.


Edit: Thanks to @gwenzek's first post, though, now I know I can search for synsyn with no spaces and find it successfully.