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 invisible worktree updates (#47990)

Lukas Wirth28f0461e947e
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index c809ad234d0..4341d61fbe6 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -1306,12 +1306,18 @@ impl Workspace {
this.collaborator_left(*peer_id, window, cx);
}
- project::Event::WorktreeRemoved(_) | project::Event::WorktreeAdded(..) => {
+ &project::Event::WorktreeRemoved(id) | &project::Event::WorktreeAdded(id) => {
this.update_window_title(window, cx);
- this.serialize_workspace(window, cx);
- this.update_history(cx);
+ if this
+ .project()
+ .read(cx)
+ .worktree_for_id(id, cx)
+ .is_some_and(|wt| wt.read(cx).is_visible())
+ {
+ this.serialize_workspace(window, cx);
+ this.update_history(cx);
+ }
}
-
project::Event::WorktreeUpdatedEntries(..) => {
this.update_window_title(window, cx);
this.serialize_workspace(window, cx);