list editor : remove debug prints
This commit is contained in:
parent
fc9ac6cac7
commit
0062e5ca07
2 changed files with 3 additions and 17 deletions
|
@ -269,7 +269,6 @@ impl ListEditor {
|
||||||
|
|
||||||
/// split the list off at the current cursor position and return the second half
|
/// split the list off at the current cursor position and return the second half
|
||||||
pub fn split(&mut self) -> ListEditor {
|
pub fn split(&mut self) -> ListEditor {
|
||||||
eprintln!("split!");
|
|
||||||
let mut le = ListEditor::new(
|
let mut le = ListEditor::new(
|
||||||
Arc::new(RwLock::new(self.ctx.read().unwrap().clone())),
|
Arc::new(RwLock::new(self.ctx.read().unwrap().clone())),
|
||||||
self.typ.clone());
|
self.typ.clone());
|
||||||
|
@ -285,12 +284,9 @@ impl ListEditor {
|
||||||
if self.is_listlist() {
|
if self.is_listlist() {
|
||||||
if idx > 0 && idx < self.data.len()+1 {
|
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);
|
let prev_node = self.data.get(prev_idx);
|
||||||
|
|
||||||
eprintln!("try locking prev node");
|
|
||||||
let prev_node = prev_node.read().unwrap();
|
let prev_node = prev_node.read().unwrap();
|
||||||
eprintln!("locked prev node");
|
|
||||||
|
|
||||||
if let Some(prev_editor) = prev_node.editor.get() {
|
if let Some(prev_editor) = prev_node.editor.get() {
|
||||||
let prev_editor = prev_editor.downcast::<RwLock<ListEditor>>().unwrap();
|
let prev_editor = prev_editor.downcast::<RwLock<ListEditor>>().unwrap();
|
||||||
|
@ -346,27 +342,21 @@ impl ListEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn listlist_split(&mut self) {
|
pub fn listlist_split(&mut self) {
|
||||||
eprintln!("listlist split");
|
|
||||||
let cur = self.get_cursor();
|
let cur = self.get_cursor();
|
||||||
|
|
||||||
eprintln!("cur = {:?}", cur);
|
|
||||||
if let Some(item) = self.get_item() {
|
if let Some(item) = self.get_item() {
|
||||||
eprintln!("got item");
|
|
||||||
// let item = item.read().unwrap();
|
// let item = item.read().unwrap();
|
||||||
let depth = item.depth;
|
let depth = item.depth;
|
||||||
|
|
||||||
if let Some(head_editor) = item.editor.get() {
|
if let Some(head_editor) = item.editor.get() {
|
||||||
eprintln!("got head editor");
|
|
||||||
let head = head_editor.downcast::<RwLock<ListEditor>>().unwrap();
|
let head = head_editor.downcast::<RwLock<ListEditor>>().unwrap();
|
||||||
let mut head = head.write().unwrap();
|
let mut head = head.write().unwrap();
|
||||||
|
|
||||||
if head.data.len() > 0 {
|
if head.data.len() > 0 {
|
||||||
eprintln!("data len > 0");
|
|
||||||
if cur.tree_addr.len() > 2 {
|
if cur.tree_addr.len() > 2 {
|
||||||
head.listlist_split();
|
head.listlist_split();
|
||||||
}
|
}
|
||||||
|
|
||||||
eprintln!("split head");
|
|
||||||
let mut tail = head.split();
|
let mut tail = head.split();
|
||||||
|
|
||||||
head.goto(TreeCursor::none());
|
head.goto(TreeCursor::none());
|
||||||
|
|
|
@ -337,16 +337,13 @@ impl ObjCommander for PTYListController {
|
||||||
ListCursorMode::Select => {
|
ListCursorMode::Select => {
|
||||||
if let Some(mut item) = e.get_item_mut() {
|
if let Some(mut item) = e.get_item_mut() {
|
||||||
|
|
||||||
eprintln!("send cmd to child");
|
|
||||||
let mut i = item.write().unwrap();
|
let mut i = item.write().unwrap();
|
||||||
let res = i.send_cmd_obj(cmd_obj.clone());
|
let res = i.send_cmd_obj(cmd_obj.clone());
|
||||||
|
|
||||||
let close_char = i.close_char.get();
|
let close_char = i.close_char.get();
|
||||||
eprintln!("close char = {:?}", close_char);
|
|
||||||
drop(i);
|
drop(i);
|
||||||
drop(item);
|
drop(item);
|
||||||
|
|
||||||
eprintln!("back");
|
|
||||||
match res {
|
match res {
|
||||||
TreeNavResult::Continue => {
|
TreeNavResult::Continue => {
|
||||||
TreeNavResult::Continue
|
TreeNavResult::Continue
|
||||||
|
@ -354,7 +351,6 @@ impl ObjCommander for PTYListController {
|
||||||
|
|
||||||
TreeNavResult::Exit => {
|
TreeNavResult::Exit => {
|
||||||
if cmd_type == char_type {
|
if cmd_type == char_type {
|
||||||
eprintln!("char event event");
|
|
||||||
let co = cmd_obj.read().unwrap();
|
let co = cmd_obj.read().unwrap();
|
||||||
if let Some(cmd_view) = co.get_view::<dyn SingletonView<Item = char>>() {
|
if let Some(cmd_view) = co.get_view::<dyn SingletonView<Item = char>>() {
|
||||||
drop(co);
|
drop(co);
|
||||||
|
|
Loading…
Reference in a new issue