mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
file_finder: Simplify removal of file name from file path (#7398)
This PR simplifies the removal of the file name from the file path when computing the file finder matches. Release Notes: - N/A
This commit is contained in:
parent
ce62404e24
commit
21797bad4d
1 changed files with 1 additions and 6 deletions
|
@ -584,12 +584,7 @@ impl FileFinderDelegate {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Trim file name from the full path
|
let full_path = full_path.trim_end_matches(&file_name).to_string();
|
||||||
let full_path = if full_path.len() > file_name.len() {
|
|
||||||
full_path[..full_path.len() - file_name.len() - 1].to_string()
|
|
||||||
} else {
|
|
||||||
"".to_string()
|
|
||||||
};
|
|
||||||
path_positions.retain(|idx| *idx < full_path.len());
|
path_positions.retain(|idx| *idx < full_path.len());
|
||||||
|
|
||||||
(file_name, file_name_positions, full_path, path_positions)
|
(file_name, file_name_positions, full_path, path_positions)
|
||||||
|
|
Loading…
Reference in a new issue