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![],
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -181,3 +181,4 @@ pub trait TreeNav {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,18 +32,15 @@ struct NestedNodeEdit {
|
|||
/// abstract editor
|
||||
pub editor: SingletonBuffer<
|
||||
Option< Arc<dyn Any + Send + Sync> >
|
||||
>,
|
||||
>,
|
||||
|
||||
pub input_buf:: VecBuffer< NestedNode >,
|
||||
pub output_buf: VecBuffer< NestedNode >,
|
||||
pub spillbuf: VecBuffer< NestedNode >,
|
||||
|
||||
/// commander & navigation
|
||||
pub cmd: SingletonBuffer<
|
||||
Option< Arc<RwLock<dyn ObjCommander + Send + Sync>> >
|
||||
>,
|
||||
pub close_char: SingletonBuffer<
|
||||
Option< char >
|
||||
>,
|
||||
pub close_char: SingletonBuffer< Option< char > >,
|
||||
|
||||
// could be replaced by cmd when TreeNav -CmdObjects are used
|
||||
pub tree_nav: SingletonBuffer<
|
||||
|
|
|
@ -7,8 +7,8 @@ use {
|
|||
};
|
||||
|
||||
pub trait TreeType {
|
||||
fn get_type(&self, _addr: &TreeAddr) -> TypeTerm {
|
||||
TypeTerm::new(TypeID::Var(0))
|
||||
fn get_type(&self, addr: &TreeAddr) -> Vec<TypeTerm> {
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue