Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

file_finder: Fix crash in new_path_prompt (#16991)

CharlesChen08230853cb573f2d
diff --git a/crates/file_finder/src/new_path_prompt.rs b/crates/file_finder/src/new_path_prompt.rs
index 2d5be8dae12..e992dd315fa 100644
--- a/crates/file_finder/src/new_path_prompt.rs
+++ b/crates/file_finder/src/new_path_prompt.rs
@@ -107,8 +107,10 @@ impl Match {
if let Some(path_match) = &self.path_match {
text.push_str(&path_match.path.to_string_lossy());
+ let mut whole_path = PathBuf::from(path_match.path_prefix.to_string());
+ whole_path = whole_path.join(path_match.path.clone());
for (range, style) in highlight_ranges(
- &path_match.path.to_string_lossy(),
+ &whole_path.to_string_lossy(),
&path_match.positions,
gpui::HighlightStyle::color(Color::Accent.color(cx)),
) {