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.

editor: Fix inconsistent search behavior for untitled/temporary tabs (#37086)

Liu Jinyi69bdef38ecef
diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs
index 8a07939cf47..48c3a8a41a8 100644
--- a/crates/editor/src/items.rs
+++ b/crates/editor/src/items.rs
@@ -651,7 +651,8 @@ impl Item for Editor {
if let Some(path) = path_for_buffer(&self.buffer, detail, true, cx) {
path.to_string_lossy().to_string().into()
} else {
- "untitled".into()
+ // Use the same logic as the displayed title for consistency
+ self.buffer.read(cx).title(cx).to_string().into()
}
}