From b220d264e47c3829740c3b2194fa314c93277aab Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Mon, 7 Aug 2023 07:40:49 +0200 Subject: [PATCH] list editor: fix deadlock --- nested/src/editors/list/pty_editor.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/nested/src/editors/list/pty_editor.rs b/nested/src/editors/list/pty_editor.rs index fe1cb57..b3c4c61 100644 --- a/nested/src/editors/list/pty_editor.rs +++ b/nested/src/editors/list/pty_editor.rs @@ -336,24 +336,34 @@ impl ObjCommander for PTYListController { }, ListCursorMode::Select => { if let Some(mut item) = e.get_item_mut() { - match item.write().unwrap().send_cmd_obj(cmd_obj.clone()) { + + 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 } 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); let c = cmd_view.get(); - //eprintln!("close char = {:?}", item.close_char); - if Some(c) == self.split_char { e.listlist_split(); TreeNavResult::Continue - } else if Some(c) == item.read().unwrap().close_char.get() { + } else if Some(c) == close_char { //eprintln!("listedit: exit from select (close)"); //item.goto(TreeCursor::none()); e.cursor.set(ListCursor {