Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
acp: Skip setting language on secondary diff buffer (#47526)
Jakub Konka6f090d3656ed
diff --git a/crates/acp_thread/src/diff.rs b/crates/acp_thread/src/diff.rsindex d04cabb39d7..9e47e70814b 100644--- a/crates/acp_thread/src/diff.rs+++ b/crates/acp_thread/src/diff.rs@@ -90,9 +90,10 @@ impl Diff {let mut diff = BufferDiff::new_unchanged(&buffer_text_snapshot, cx);diff.language_changed(language.clone(), language_registry.clone(), cx);let secondary_diff = cx.new(|cx| {- let mut diff = BufferDiff::new_unchanged(&buffer_text_snapshot, cx);- diff.language_changed(language, language_registry, cx);- diff+ // For the secondary diff buffer we skip assigning the language as we do not really need to perform any syntax highlighting on+ // it. As a result, by skipping it we are potentially shaving off a lot of RSS plus we get a snappier feel for large diff+ // view multibuffers.+ BufferDiff::new_unchanged(&buffer_text_snapshot, cx)});diff.set_secondary_diff(secondary_diff);diff@@ -408,7 +409,6 @@ async fn build_buffer_diff(secondary_diff.update(cx, |secondary_diff, cx| {- secondary_diff.language_changed(language.clone(), language_registry.clone(), cx);secondary_diff.set_snapshot(update.clone(), &buffer, cx)}).await;