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: Skip setting language on git index buffer (#47524)

Jakub Konka3d4582d4dc91
diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs
index 1f705671163..35c560d6a57 100644
--- a/crates/project/src/git_store.rs
+++ b/crates/project/src/git_store.rs
@@ -3210,9 +3210,9 @@ impl BufferGitState {
unstaged_diff.as_ref().zip(new_unstaged_diff.clone())
{
let task = unstaged_diff.update(cx, |diff, cx| {
- if language_changed {
- diff.language_changed(language.clone(), language_registry.clone(), cx);
- }
+ // For git index 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.
diff.set_snapshot(new_unstaged_diff, &buffer, cx)
});
Some(task.await)