Skip to content

Commit

Permalink
Shorten overflowing paths in file finder (#25303)
Browse files Browse the repository at this point in the history
Closes #7711

This PR changes the file finder to shorten the path portion of each
match by replacing a segment with `...`, if it would otherwise overflow
horizontally. Details:

- The overflow calculation is based on a crude linear width estimate for
ASCII text at the current em width. No elision is done for non-ASCII
paths.
- A path component will not be elided if it contains a matching position
for the file finder's search, or if it's the first or last component.
- Elision is only applied when it is successful in shortening the path
enough to not overflow.

Release Notes:

- Improved the appearance of the file finder when long paths are shown
by eliding path segments
  • Loading branch information
cole-miller authored Feb 21, 2025
1 parent 7ff4009 commit aba89ba
Show file tree
Hide file tree
Showing 2 changed files with 399 additions and 177 deletions.
Loading

0 comments on commit aba89ba

Please sign in to comment.