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: Add missing `language_changed` notification for branch diffs (#53757)

Cole Miller9264f7f88354
diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs
index a00e2dcfc86..c760203dcdb 100644
--- a/crates/project/src/git_store.rs
+++ b/crates/project/src/git_store.rs
@@ -3635,7 +3635,7 @@ impl BufferGitState {
uncommitted_diff
.update(cx, |diff, cx| {
if language_changed {
- diff.language_changed(language.clone(), language_registry, cx);
+ diff.language_changed(language.clone(), language_registry.clone(), cx);
}
diff.set_snapshot_with_secondary(
new_uncommitted_diff,
@@ -3664,7 +3664,12 @@ impl BufferGitState {
.await;
oid_diff
- .update(cx, |diff, cx| diff.set_snapshot(new_oid_diff, &buffer, cx))
+ .update(cx, |diff, cx| {
+ if language_changed {
+ diff.language_changed(language.clone(), language_registry.clone(), cx);
+ }
+ diff.set_snapshot(new_oid_diff, &buffer, cx)
+ })
.await;
log::debug!(