mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
allow quitting (ctrl+c) everywhere
This commit is contained in:
parent
c638eb0329
commit
c42a421828
1 changed files with 13 additions and 4 deletions
17
src/app.rs
17
src/app.rs
|
|
@ -172,10 +172,6 @@ impl App {
|
|||
flags.insert(NeedsUpdate::COMMANDS);
|
||||
} else if let Event::Key(k) = ev {
|
||||
let new_flags = match k {
|
||||
keys::EXIT => {
|
||||
self.do_quit = true;
|
||||
NeedsUpdate::empty()
|
||||
}
|
||||
keys::FOCUS_WORKDIR => {
|
||||
self.switch_focus(Focus::WorkDir)
|
||||
}
|
||||
|
|
@ -206,6 +202,8 @@ impl App {
|
|||
flags.insert(new_flags);
|
||||
}
|
||||
|
||||
self.check_quit(ev);
|
||||
|
||||
let new_flags = self.process_queue();
|
||||
flags.insert(new_flags);
|
||||
|
||||
|
|
@ -298,6 +296,17 @@ impl App {
|
|||
None
|
||||
}
|
||||
|
||||
fn check_quit(&mut self, ev: Event) {
|
||||
if let Event::Key(e) = ev {
|
||||
match e {
|
||||
keys::EXIT => {
|
||||
self.do_quit = true;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn toggle_tabs(&mut self) {
|
||||
self.tab += 1;
|
||||
self.tab %= 2;
|
||||
|
|
|
|||
Loading…
Reference in a new issue