As can be seen in the attached video, a simple search can result in all of the relevant results being buried at the bottom, while everything in a nearly-irrelevant directory with deeply nested subdirectories appears at the top.
I believe the simplest and most general-purpose solution involves one primary fix and possibly another related fix.
First, the percentage of the query that is matched by the file path should be treated as important. If the query covers 80% of the full path (including file name) of one file, that should be placed way above something for which the query matches only 20%.
The second thing (which could be seen as a separate problem but is slightly related) is to treat contiguous characters as far more important than discontiguous characters. I'm not 100% sure this is currently a problem with Zed, but if memory serves me well I've seen this occur in Zed (and definitely other apps like Alfred, where searching is a central feature) where I type a word and first am presented with things that don't look remotely like matches but which have very long names and therefore will match just about anything that is typed.
In the example I gave, one might argue that those files belong at the bottom because what I typed is in the directory path rather than the file name, and I would agree that file name should be more important than directory path, but not to such an extreme that dozens of irrelevant results take precendence over the far more important results that are the part of my project that I actually personally edit. (I'm not expecting Zed to know that the vendor directory is full of stuff I don't care about, which is why I'm offering a general-purpose proposal to solve not just this case but many others.)
If applicable, add mockups / screenshots to help present your vision of the feature
Check for existing issues
Describe the feature
As can be seen in the attached video, a simple search can result in all of the relevant results being buried at the bottom, while everything in a nearly-irrelevant directory with deeply nested subdirectories appears at the top.
I believe the simplest and most general-purpose solution involves one primary fix and possibly another related fix.
First, the percentage of the query that is matched by the file path should be treated as important. If the query covers 80% of the full path (including file name) of one file, that should be placed way above something for which the query matches only 20%.
The second thing (which could be seen as a separate problem but is slightly related) is to treat contiguous characters as far more important than discontiguous characters. I'm not 100% sure this is currently a problem with Zed, but if memory serves me well I've seen this occur in Zed (and definitely other apps like Alfred, where searching is a central feature) where I type a word and first am presented with things that don't look remotely like matches but which have very long names and therefore will match just about anything that is typed.
In the example I gave, one might argue that those files belong at the bottom because what I typed is in the directory path rather than the file name, and I would agree that file name should be more important than directory path, but not to such an extreme that dozens of irrelevant results take precendence over the far more important results that are the part of my project that I actually personally edit. (I'm not expecting Zed to know that the
vendor
directory is full of stuff I don't care about, which is why I'm offering a general-purpose proposal to solve not just this case but many others.)If applicable, add mockups / screenshots to help present your vision of the feature
https://github.com/user-attachments/assets/087f3a7e-721f-4b2f-ab95-60f62f67fa60