diff options
author | Sam Tay <sam.chong.tay@gmail.com> | 2020-07-04 14:18:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 14:18:31 -0700 |
commit | d5b313d2eeb83c4c4aebb8bd0d006700298f63da (patch) | |
tree | a4f55386a1d6e17e5083e17ca230189300922e85 | |
parent | e332a12eca11d8af61df75a388eed72e73324f89 (diff) | |
parent | 4fcb633662aea1cdc941a51147a91354d0b53988 (diff) |
Merge pull request #1 from zynaxsoft/feat/quit-on-q
Add "q" key binding for exitting the app.
-rw-r--r-- | src/tui/app.rs | 2 | ||||
-rw-r--r-- | src/tui/views.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/tui/app.rs b/src/tui/app.rs index accb1de..a4bb03e 100644 --- a/src/tui/app.rs +++ b/src/tui/app.rs @@ -156,7 +156,7 @@ pub fn help() -> Dialog { **G**: Scroll To Bottom ## Misc -**ZZ, Ctrl<c>**: Exit +**q, ZZ, Ctrl<c>**: Exit **?**: Toggle this help menu "###; Dialog::around( diff --git a/src/tui/views.rs b/src/tui/views.rs index f191830..a7d3885 100644 --- a/src/tui/views.rs +++ b/src/tui/views.rs @@ -538,6 +538,9 @@ impl<T: View> ViewWrapper for VimBindingsView<T> { _ => self.last_event = None, } match event { + Event::Char('q') => { + return EventResult::with_cb(|s| s.quit()); + } Event::Char('h') => { return self.view.on_event(Event::Key(Key::Left)); } |