zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.94k stars 3.16k forks source link

Ordering of search tokens in file finder fuzzy match #14428

Open knadh opened 4 months ago

knadh commented 4 months ago

Check for existing issues

Describe the feature

Firstly, zed looks, feels, and works great! Thank you. I've been playing with it it since the Linux release and stumbled upon this muscle-memory quality-of-life enhancement.

Universally, fuzzy search in file finder widgets across editors are agnostic of the ordering of search tokens. For instance, the search inputs internal auth and auth internal should fuzzy-match the path /internal/auth. However, in the current version of zed (v0.143.7), the search is not ordering agnostic. In the above example, only internal auth produces a hit. Screenshots below.

Possibly related: https://github.com/zed-industries/zed/issues/7586

If applicable, add mockups / screenshots to help present your vision of the feature

Actual path: /internal/auth

Results for auth image

Results for internal auth image

Results for auth internal. Ideally, this should also produce the same result. image

Comparison

vscode image

Sublime image

baptisteArno commented 3 months ago

This! Often times, I look for a particular file, type the name of it, see that the search query is not specific enough so I add a parent folder name to the query. But in Zed that does not work, I have to type the folder name before the file name.

haasn commented 1 month ago

I would also like to add that already opened files should be preferred to other files. I might have a project with a dozen files named utils.c. Whenever I want to quickly switch to the particular utils.c I'm already editing, I either have to manually go through this list, or always remember to type the right prefix as well.

Alternatively, maybe we could get a "buffer search" command which only completes against already opened buffers.