From ec6180af51f60e6d9b55f131e2e92d108713683a Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sun, 10 May 2020 13:27:46 +0200 Subject: [PATCH] only quit gitui on Ctrl+c from now on --- src/app.rs | 2 +- src/keys.rs | 4 ++-- src/strings.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.rs b/src/app.rs index b4953cc7..6d044a4a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -172,7 +172,7 @@ impl App { flags.insert(NeedsUpdate::COMMANDS); } else if let Event::Key(k) = ev { let new_flags = match k { - keys::EXIT_1 | keys::EXIT_2 => { + keys::EXIT => { self.do_quit = true; NeedsUpdate::empty() } diff --git a/src/keys.rs b/src/keys.rs index b9577e9d..f87c7a3b 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -19,9 +19,9 @@ pub const FOCUS_WORKDIR: KeyEvent = no_mod(KeyCode::Char('1')); pub const FOCUS_STAGE: KeyEvent = no_mod(KeyCode::Char('2')); pub const FOCUS_RIGHT: KeyEvent = no_mod(KeyCode::Right); pub const FOCUS_LEFT: KeyEvent = no_mod(KeyCode::Left); -pub const EXIT_1: KeyEvent = no_mod(KeyCode::Esc); +pub const EXIT: KeyEvent = + with_mod(KeyCode::Char('c'), KeyModifiers::CONTROL); pub const EXIT_POPUP: KeyEvent = no_mod(KeyCode::Esc); -pub const EXIT_2: KeyEvent = no_mod(KeyCode::Char('q')); pub const CLOSE_MSG: KeyEvent = no_mod(KeyCode::Enter); pub const OPEN_COMMIT: KeyEvent = no_mod(KeyCode::Char('c')); pub const OPEN_HELP: KeyEvent = no_mod(KeyCode::Char('h')); diff --git a/src/strings.rs b/src/strings.rs index 5ea13395..39b9bdbd 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -136,7 +136,7 @@ pub mod commands { ); /// pub static QUIT: CommandText = CommandText::new( - "Quit [esc,q]", + "Quit [ctrl+c]", "quit gitui application", CMD_GROUP_GENERAL, );