mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 02:37:05 +00:00
workspace level integration of serialization complete! Time for item level integration....
Co-Authored-By: kay@zed.dev
This commit is contained in:
parent
992b94eef3
commit
7ceb5e815e
1 changed files with 11 additions and 3 deletions
|
@ -211,13 +211,13 @@ impl WorkspaceDb {
|
||||||
&self,
|
&self,
|
||||||
workspace_id: &WorkspaceId,
|
workspace_id: &WorkspaceId,
|
||||||
) -> Result<SerializedPaneGroup> {
|
) -> Result<SerializedPaneGroup> {
|
||||||
self.get_pane_group_children(workspace_id, None)?
|
self.get_pane_group(workspace_id, None)?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.next()
|
.next()
|
||||||
.context("No center pane group")
|
.context("No center pane group")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_pane_group_children(
|
fn get_pane_group(
|
||||||
&self,
|
&self,
|
||||||
workspace_id: &WorkspaceId,
|
workspace_id: &WorkspaceId,
|
||||||
group_id: Option<GroupId>,
|
group_id: Option<GroupId>,
|
||||||
|
@ -254,7 +254,7 @@ impl WorkspaceDb {
|
||||||
if let Some((group_id, axis)) = group_id.zip(axis) {
|
if let Some((group_id, axis)) = group_id.zip(axis) {
|
||||||
Ok(SerializedPaneGroup::Group {
|
Ok(SerializedPaneGroup::Group {
|
||||||
axis,
|
axis,
|
||||||
children: self.get_pane_group_children(
|
children: self.get_pane_group(
|
||||||
workspace_id,
|
workspace_id,
|
||||||
Some(group_id),
|
Some(group_id),
|
||||||
)?,
|
)?,
|
||||||
|
@ -265,6 +265,14 @@ impl WorkspaceDb {
|
||||||
bail!("Pane Group Child was neither a pane group or a pane");
|
bail!("Pane Group Child was neither a pane group or a pane");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// Filter out panes and pane groups which don't have any children or items
|
||||||
|
.filter(|pane_group| {
|
||||||
|
match pane_group {
|
||||||
|
Ok(SerializedPaneGroup::Group { children, .. }) => !children.is_empty(),
|
||||||
|
Ok(SerializedPaneGroup::Pane(pane)) => !pane.children.is_empty(),
|
||||||
|
_ => true,
|
||||||
|
}
|
||||||
|
})
|
||||||
.collect::<Result<_>>()
|
.collect::<Result<_>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue