add get_subcursor()
This commit is contained in:
parent
10bff8a32c
commit
153faf9c13
4 changed files with 17 additions and 8 deletions
|
@ -24,6 +24,17 @@ impl TreeCursor {
|
||||||
tree_addr: vec![],
|
tree_addr: vec![],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_subcursor(&self, depth: usize) -> TreeCursor {
|
||||||
|
TreeCursor {
|
||||||
|
leaf_mode: self.leaf_mode,
|
||||||
|
tree_addr: if depth < self.tree_addr.len() {
|
||||||
|
self.tree_addr[ depth.. ].iter().cloned().collect()
|
||||||
|
} else {
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TreeCursor {
|
impl Default for TreeCursor {
|
||||||
|
|
|
@ -181,3 +181,4 @@ pub trait TreeNav {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,16 +34,13 @@ struct NestedNodeEdit {
|
||||||
Option< Arc<dyn Any + Send + Sync> >
|
Option< Arc<dyn Any + Send + Sync> >
|
||||||
>,
|
>,
|
||||||
|
|
||||||
pub input_buf:: VecBuffer< NestedNode >,
|
pub spillbuf: VecBuffer< NestedNode >,
|
||||||
pub output_buf: VecBuffer< NestedNode >,
|
|
||||||
|
|
||||||
/// commander & navigation
|
/// commander & navigation
|
||||||
pub cmd: SingletonBuffer<
|
pub cmd: SingletonBuffer<
|
||||||
Option< Arc<RwLock<dyn ObjCommander + Send + Sync>> >
|
Option< Arc<RwLock<dyn ObjCommander + Send + Sync>> >
|
||||||
>,
|
>,
|
||||||
pub close_char: SingletonBuffer<
|
pub close_char: SingletonBuffer< Option< char > >,
|
||||||
Option< char >
|
|
||||||
>,
|
|
||||||
|
|
||||||
// could be replaced by cmd when TreeNav -CmdObjects are used
|
// could be replaced by cmd when TreeNav -CmdObjects are used
|
||||||
pub tree_nav: SingletonBuffer<
|
pub tree_nav: SingletonBuffer<
|
||||||
|
|
|
@ -7,8 +7,8 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait TreeType {
|
pub trait TreeType {
|
||||||
fn get_type(&self, _addr: &TreeAddr) -> TypeTerm {
|
fn get_type(&self, addr: &TreeAddr) -> Vec<TypeTerm> {
|
||||||
TypeTerm::new(TypeID::Var(0))
|
vec![]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue