# file_finder: Remove common segments of long paths in search results \(\#25049\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 9ef0501853825db41e702c03ab398bf531a8bc1f

Requested commit: 9ef0501853825db41e702c03ab398bf531a8bc1f

Commit: 9ef0501853825db41e702c03ab398bf531a8bc1f

Tree: 31f3afc84be0a24cad98c54651d1d0acdc69c711

Author: Cole Miller

Committer: GitHub

## Message

```
file_finder: Remove common segments of long paths in search results (#25049)

This PR makes progress on #7711 by identifying any common prefix of the
paths in the file finder's search results, and replacing the "interior"
of that prefix---every path segment but the first and last---with `...`,
when a heuristic indicates that the longest path would otherwise
overflow the modal.

The elision is not applied to any segment that contains a match for the
search query.

There may be more work to do on #7711 in the case of long result paths
that do not share a significant common prefix.

Release Notes:

- Improved display of long paths in the file finder modal

Co-authored-by: Max <max@zed.dev>
```

## Parents

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

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