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.

git blame: Do not try to blame buffer if it has no file (#10985)

Thorsten Ball7ec963664e64
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index a2fc4d67cfb..9b2cfdba2bf 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -8982,6 +8982,10 @@ impl Editor {
return;
};
+ if buffer.read(cx).file().is_none() {
+ return;
+ }
+
let project = project.clone();
let blame = cx.new_model(|cx| GitBlame::new(buffer, project, user_triggered, cx));
self.blame_subscription = Some(cx.observe(&blame, |_, _, cx| cx.notify()));