Extract from Workspace a Project model that stores a window's worktrees

This commit is contained in:
Max Brunsfeld
2021-09-23 16:34:06 -07:00
parent 39fbf7d4d1
commit d561f50ab1
5 changed files with 125 additions and 82 deletions
+3 -3
View File
@@ -1157,13 +1157,13 @@ mod tests {
);
});
workspace_b
.condition(&cx_b, |workspace, _| workspace.worktrees().len() == 1)
.condition(&cx_b, |workspace, cx| workspace.worktrees(cx).len() == 1)
.await;
let local_worktree_id_b = workspace_b.read_with(&cx_b, |workspace, cx| {
let active_pane = workspace.active_pane().read(cx);
assert!(active_pane.active_item().is_none());
workspace.worktrees().iter().next().unwrap().id()
workspace.worktrees(cx).first().unwrap().id()
});
workspace_b
.update(&mut cx_b, |worktree, cx| {
@@ -1180,7 +1180,7 @@ mod tests {
tree.as_local_mut().unwrap().unshare(cx);
});
workspace_b
.condition(&cx_b, |workspace, _| workspace.worktrees().len() == 0)
.condition(&cx_b, |workspace, cx| workspace.worktrees(cx).len() == 0)
.await;
workspace_b.read_with(&cx_b, |workspace, cx| {
let active_pane = workspace.active_pane().read(cx);