# file_finder: Prioritize file name matches over path matches \(\#27937\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b2904e5d9fb0344a8039de0ce1538461b1b2addd)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b2904e5d9fb0344a8039de0ce1538461b1b2addd

Requested commit: b2904e5d9fb0344a8039de0ce1538461b1b2addd

Commit: b2904e5d9fb0344a8039de0ce1538461b1b2addd

Tree: d11e9ac108d3feec738eaa102f234f61c31f5d5f

Author: Smit Barmase

Committer: GitHub

## Message

```
file_finder: Prioritize file name matches over path matches (#27937)

Closes https://github.com/zed-industries/zed/issues/27936

Adds additional comparison after the existing history-based comparison.

This comparison checks whether the first position matched via fuzzy
search is in the file name. If so, we prioritize this match over one in
the path. If both items match either the file name or the path, the
existing comparison logic is used.

- [x] Tests

Before:
<img width="580" alt="image"
src="https://github.com/user-attachments/assets/011fdd01-3dfa-4950-abb1-dfda10885664"
/>

After:
<img width="614" alt="image"
src="https://github.com/user-attachments/assets/9c4944b0-83dc-4611-94bb-aae1758fab23"
/>


Release Notes:

- Fixed an issue where fuzzy matching in file finder did not properly
prioritize matches in file names.
```

## Parents

- [45e7cd1638f6c2e932a6d7589b26659a1bbc2728](https://git.cafe/gitcafe/zed/commit/45e7cd1638f6c2e932a6d7589b26659a1bbc2728?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b2904e5d9fb0344a8039de0ce1538461b1b2addd?format=markdown)
