From 647a5d77b688feafcd73d1da12bd8b7bee4006e1 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Thu, 18 Jan 2024 21:34:14 +0100 Subject: [PATCH] list: reactivate item creation on split --- lib-nested-core/src/editors/list/editor.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib-nested-core/src/editors/list/editor.rs b/lib-nested-core/src/editors/list/editor.rs index 2b0bfff..f0e7cb7 100644 --- a/lib-nested-core/src/editors/list/editor.rs +++ b/lib-nested-core/src/editors/list/editor.rs @@ -307,8 +307,14 @@ impl ListEditor { self.nexd(); let mut b = item.ctrl.spillbuf.write().unwrap(); -/* TODO - let mut tail_node = Context::make_node(&self.ctx, self.typ.clone(), self.depth.map(|d| d+1)).unwrap(); + + let rt = ReprTree::new_arc(self.typ.clone()); + let new_edittree = self.ctx.read().unwrap() + .setup_edittree( + rt, + self.depth.map(|d| d+1) + ); + let mut tail_node = new_edittree.write().unwrap(); tail_node.goto(TreeCursor::home()); for node in b.iter() { @@ -316,7 +322,7 @@ impl ListEditor { .send_cmd_obj( ReprTree::new_leaf( Context::parse(&self.ctx, "NestedNode"), - SingletonBuffer::::new( + SingletonBuffer::::new( node.read().unwrap().clone() ).get_port().into() ) @@ -331,11 +337,12 @@ impl ListEditor { if cur.tree_addr.len() > 1 { tail_node.dn(); } + drop(tail_node); self.insert( - Arc::new(RwLock::new(tail_node)) + new_edittree ); -*/ + } else { self.up(); self.listlist_split();