feat: implement TreeState select first/last

This commit is contained in:
EdJoPaTo
2022-08-31 15:04:25 +02:00
parent c0e4967b88
commit b01956741b
3 changed files with 26 additions and 1 deletions
+3 -1
View File
@@ -91,11 +91,13 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Result<(
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Char('q') => return Ok(()),
KeyCode::Char('\n' | ' ') => app.tree.toggle(),
KeyCode::Left => app.tree.left(),
KeyCode::Right => app.tree.right(),
KeyCode::Char('\n') => app.tree.toggle(),
KeyCode::Down => app.tree.down(),
KeyCode::Up => app.tree.up(),
KeyCode::Home => app.tree.first(),
KeyCode::End => app.tree.last(),
_ => {}
}
}