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.

workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882)

Lukas Wirth1321aa932ca5
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 4dad00f1586..5a8011bb357 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -1303,12 +1303,15 @@ impl Workspace {
this.collaborator_left(*peer_id, window, cx);
}
- project::Event::WorktreeRemoved(_) => {
- this.update_worktree_data(window, cx);
+ project::Event::WorktreeRemoved(_) | project::Event::WorktreeAdded(..) => {
+ this.update_window_title(window, cx);
+ this.serialize_workspace(window, cx);
+ this.update_history(cx);
}
- project::Event::WorktreeUpdatedEntries(..) | project::Event::WorktreeAdded(..) => {
- this.update_worktree_data(window, cx);
+ project::Event::WorktreeUpdatedEntries(..) => {
+ this.update_window_title(window, cx);
+ this.serialize_workspace(window, cx);
}
project::Event::DisconnectedFromHost => {
@@ -6731,13 +6734,6 @@ impl Workspace {
}
}
}
-
- fn update_worktree_data(&mut self, window: &mut Window, cx: &mut Context<'_, Self>) {
- self.update_window_title(window, cx);
- self.serialize_workspace(window, cx);
- // This event could be triggered by `AddFolderToProject` or `RemoveFromProject`.
- self.update_history(cx);
- }
}
fn leader_border_for_pane(