Skip to content

Commit aee8721

Browse files
aiyouxStephan Dilly
authored andcommitted
run rustfmt and fix vim style key config test failure
1 parent f29ba72 commit aee8721

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/app.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ impl App {
261261
log::trace!("event: {:?}", ev);
262262

263263
if let InputEvent::Input(ev) = ev {
264-
if self.check_quit_key(ev) || self.check_weak_quit_key(ev) {
264+
if self.check_quit_key(ev) || self.check_weak_quit_key(ev)
265+
{
265266
return Ok(());
266267
}
267268

@@ -451,12 +452,15 @@ impl App {
451452
msg
452453
]
453454
);
454-
455+
455456
fn check_weak_quit_key(&mut self, ev: Event) -> bool {
456-
if self.any_popup_visible() { return false }
457+
if self.any_popup_visible() {
458+
return false;
459+
}
457460
if let Event::Key(e) = ev {
458-
if e == self.key_config.exit_if_no_popup ||
459-
e == self.key_config.exit_popup {
461+
if e == self.key_config.exit_if_no_popup
462+
|| e == self.key_config.exit_popup
463+
{
460464
self.do_quit = true;
461465
return true;
462466
}

vim_style_key_config.ron

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
open_help: ( code: F(1), modifiers: ( bits: 0,),),
2828

2929
exit: ( code: Char('Q'), modifiers: ( bits: 1,),),
30+
exit_if_no_popup: ( code: Char('q'), modifiers: ( bits: 0,),),
3031
exit_popup: ( code: Esc, modifiers: ( bits: 0,),),
3132

3233
open_commit: ( code: Char('c'), modifiers: ( bits: 0,),),

0 commit comments

Comments
 (0)