Add PathExt
trait (#2823)
This PR adds a `PathExt` trait. It pulls in our existing `compact()` function, as a method, and then adds a method, and testing, for `icon_suffix()`. A test was added to fix: - https://github.com/zed-industries/community/issues/1877 Release Notes: - Fixed a bug where file icons would not be registered for files with with `.` characters in their name ([#1877](https://github.com/zed-industries/community/issues/1877)).
This commit is contained in:
parent
ad4fd7619b
commit
ee1b4a52cc
5 changed files with 88 additions and 56 deletions
|
@ -5,6 +5,7 @@ use gpui::{
|
|||
elements::{Label, LabelStyle},
|
||||
AnyElement, Element, View,
|
||||
};
|
||||
use util::paths::PathExt;
|
||||
use workspace::WorkspaceLocation;
|
||||
|
||||
pub struct HighlightedText {
|
||||
|
@ -61,7 +62,7 @@ impl HighlightedWorkspaceLocation {
|
|||
.paths()
|
||||
.iter()
|
||||
.map(|path| {
|
||||
let path = util::paths::compact(&path);
|
||||
let path = path.compact();
|
||||
let highlighted_text = Self::highlights_for_path(
|
||||
path.as_ref(),
|
||||
&string_match.positions,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue