Skip to content

Commit

Permalink
Minimal event handling to allow viewing the TUI
Browse files Browse the repository at this point in the history
A way to more interactively review the UI changes.
TDD is possible, but I seem too lazy to do it ... maybe it would be
faster though.
  • Loading branch information
Sebastian Thiel committed Jun 3, 2019
1 parent 4ec1d37 commit 7f4fb35
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/interactive/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,23 @@ impl TerminalApp {
pub fn process_events<B, R>(
&mut self,
_terminal: &mut Terminal<B>,
_keys: Keys<R>,
keys: Keys<R>,
) -> Result<WalkResult, Error>
where
B: Backend,
R: io::Read + TermReadEventsAndRaw,
{
unimplemented!()
use termion::event::Key::Ctrl;

for key in keys.filter_map(Result::ok) {
match key {
Ctrl('c') => break,
_ => dbg!(&key),
};
}
Ok(WalkResult {
num_errors: self.traversal.io_errors,
})
}

pub fn initialize<B>(
Expand Down

0 comments on commit 7f4fb35

Please sign in to comment.