repr tree: create new VecBuffer in case attach_to() is called on Vec<EditTree>
This commit is contained in:
parent
508e716a6a
commit
ffeb4b8e73
1 changed files with 15 additions and 1 deletions
|
@ -187,7 +187,21 @@ impl ReprTree {
|
|||
if let Some(leaf) = self.leaf.as_mut() {
|
||||
leaf.attach_to(src_port);
|
||||
} else {
|
||||
self.leaf = Some(ReprLeaf::from_view(src_port));
|
||||
if self.type_tag == TypeTerm::App(vec![
|
||||
TypeTerm::TypeID(TypeID::Fun(11)),
|
||||
TypeTerm::TypeID(TypeID::Fun(2))
|
||||
]) {
|
||||
let mut leaf = ReprLeaf::from_vec_buffer(
|
||||
VecBuffer::<
|
||||
Arc<RwLock<crate::edit_tree::EditTree>>
|
||||
>::new()
|
||||
);
|
||||
|
||||
leaf.attach_to(src_port);
|
||||
self.leaf = Some(leaf);
|
||||
} else {
|
||||
self.leaf = Some(ReprLeaf::from_view(src_port));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue