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 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,18 +32,15 @@ struct NestedNodeEdit {
|
||||||
/// abstract editor
|
/// abstract editor
|
||||||
pub editor: SingletonBuffer<
|
pub editor: SingletonBuffer<
|
||||||
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