feat: Adding toggle (#8)
* feat: Adding toggle * Update src/lib.rs Return unneded Co-authored-by: EdJoPaTo <github@edjopato.de> Co-authored-by: EdJoPaTo <github@edjopato.de>
This commit is contained in:
@@ -82,6 +82,9 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
Key::Right => {
|
||||
app.tree.open();
|
||||
}
|
||||
Key::Char('\n') => {
|
||||
app.tree.toggle();
|
||||
}
|
||||
Key::Down => {
|
||||
app.tree.next();
|
||||
}
|
||||
|
||||
@@ -60,4 +60,8 @@ impl<'a> StatefulTree<'a> {
|
||||
pub fn open(&mut self) {
|
||||
self.state.open(self.state.selected());
|
||||
}
|
||||
|
||||
pub fn toggle(&mut self) {
|
||||
self.state.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user