diff --git a/src/app.rs b/src/app.rs index b98f0183..659de896 100644 --- a/src/app.rs +++ b/src/app.rs @@ -261,7 +261,8 @@ impl App { log::trace!("event: {:?}", ev); if let InputEvent::Input(ev) = ev { - if self.check_quit_key(ev) || self.check_weak_quit_key(ev) { + if self.check_quit_key(ev) || self.check_weak_quit_key(ev) + { return Ok(()); } @@ -451,12 +452,15 @@ impl App { msg ] ); - + fn check_weak_quit_key(&mut self, ev: Event) -> bool { - if self.any_popup_visible() { return false } + if self.any_popup_visible() { + return false; + } if let Event::Key(e) = ev { - if e == self.key_config.exit_if_no_popup || - e == self.key_config.exit_popup { + if e == self.key_config.exit_if_no_popup + || e == self.key_config.exit_popup + { self.do_quit = true; return true; } diff --git a/vim_style_key_config.ron b/vim_style_key_config.ron index 8fc15759..1825c805 100644 --- a/vim_style_key_config.ron +++ b/vim_style_key_config.ron @@ -27,6 +27,7 @@ open_help: ( code: F(1), modifiers: ( bits: 0,),), exit: ( code: Char('Q'), modifiers: ( bits: 1,),), + exit_if_no_popup: ( code: Char('q'), modifiers: ( bits: 0,),), exit_popup: ( code: Esc, modifiers: ( bits: 0,),), open_commit: ( code: Char('c'), modifiers: ( bits: 0,),),