run rustfmt and fix vim style key config test failure

This commit is contained in:
Levi Olorenshaw 2021-06-24 10:46:53 +10:00 committed by Stephan Dilly
parent f29ba723df
commit aee872113b
2 changed files with 10 additions and 5 deletions

View file

@ -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;
}

View file

@ -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,),),