From 0062e5ca07c93a5c4d328ea5d5c5140123b47a1e Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Tue, 8 Aug 2023 17:35:54 +0200 Subject: [PATCH] list editor : remove debug prints --- nested/src/editors/list/editor.rs | 14 ++------------ nested/src/editors/list/pty_editor.rs | 6 +----- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/nested/src/editors/list/editor.rs b/nested/src/editors/list/editor.rs index 32a1e76..517ced8 100644 --- a/nested/src/editors/list/editor.rs +++ b/nested/src/editors/list/editor.rs @@ -269,7 +269,6 @@ impl ListEditor { /// split the list off at the current cursor position and return the second half pub fn split(&mut self) -> ListEditor { - eprintln!("split!"); let mut le = ListEditor::new( Arc::new(RwLock::new(self.ctx.read().unwrap().clone())), self.typ.clone()); @@ -285,12 +284,9 @@ impl ListEditor { if self.is_listlist() { if idx > 0 && idx < self.data.len()+1 { - let prev_idx = idx - 1; // we are in insert mode, last element before cursor + let prev_idx = idx - 1; // get last element before cursor (we are in insert mode) let prev_node = self.data.get(prev_idx); - - eprintln!("try locking prev node"); let prev_node = prev_node.read().unwrap(); - eprintln!("locked prev node"); if let Some(prev_editor) = prev_node.editor.get() { let prev_editor = prev_editor.downcast::>().unwrap(); @@ -346,27 +342,21 @@ impl ListEditor { } pub fn listlist_split(&mut self) { - eprintln!("listlist split"); let cur = self.get_cursor(); - eprintln!("cur = {:?}", cur); if let Some(item) = self.get_item() { - eprintln!("got item"); // let item = item.read().unwrap(); let depth = item.depth; if let Some(head_editor) = item.editor.get() { - eprintln!("got head editor"); let head = head_editor.downcast::>().unwrap(); let mut head = head.write().unwrap(); if head.data.len() > 0 { - eprintln!("data len > 0"); if cur.tree_addr.len() > 2 { head.listlist_split(); } - eprintln!("split head"); let mut tail = head.split(); head.goto(TreeCursor::none()); @@ -420,7 +410,7 @@ impl ListEditor { let cur_editor = cur_editor.write().unwrap(); prev_editor.join(&cur_editor); - + self.cursor.set( ListCursor { idx: Some(idx - 1), mode: ListCursorMode::Select diff --git a/nested/src/editors/list/pty_editor.rs b/nested/src/editors/list/pty_editor.rs index b3c4c61..8fdac59 100644 --- a/nested/src/editors/list/pty_editor.rs +++ b/nested/src/editors/list/pty_editor.rs @@ -337,16 +337,13 @@ impl ObjCommander for PTYListController { ListCursorMode::Select => { if let Some(mut item) = e.get_item_mut() { - eprintln!("send cmd to child"); let mut i = item.write().unwrap(); let res = i.send_cmd_obj(cmd_obj.clone()); let close_char = i.close_char.get(); - eprintln!("close char = {:?}", close_char); drop(i); drop(item); - - eprintln!("back"); + match res { TreeNavResult::Continue => { TreeNavResult::Continue @@ -354,7 +351,6 @@ impl ObjCommander for PTYListController { TreeNavResult::Exit => { if cmd_type == char_type { - eprintln!("char event event"); let co = cmd_obj.read().unwrap(); if let Some(cmd_view) = co.get_view::>() { drop(co);