Skip to content

Commit

Permalink
Don't quit hard when hitting 'q'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thiel committed Jun 4, 2019
1 parent 286bfd4 commit 5d30eb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/interactive/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ impl TerminalApp {
R: io::Read + TermReadEventsAndRaw,
{
use termion::event::Key::{Char, Ctrl};
use FocussedPane::*;

self.draw(terminal)?;
for key in keys.filter_map(Result::ok) {
self.update_message();
match key {
Char('?') => {
use FocussedPane::*;
self.state.focussed = match self.state.focussed {
Main => {
self.state.help_pane = Some(HelpPaneState);
Expand All @@ -134,7 +134,14 @@ impl TerminalApp {
}
}
}
Ctrl('c') | Char('q') => break,
Ctrl('c') => break,
Char('q') => match self.state.focussed {
Main => break,
Help => {
self.state.focussed = Main;
self.state.help_pane = None
}
},
_ => {}
}

Expand Down

0 comments on commit 5d30eb6

Please sign in to comment.