diff options
author | Canop <cano.petrole@gmail.com> | 2021-05-06 21:52:07 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-05-06 21:54:18 +0200 |
commit | 6c4b5ced881851ab38e65061c46ea0760ed9c384 (patch) | |
tree | 5d09a79bc56dbc956aeb3bfe899dfe6d5d578dbf /src/app/app.rs | |
parent | f339c301135fd45db8827515a1929fab81ba13af (diff) |
config / quit_on_last_cancel
configure whether to quit when the user hits the escape
key and there's nothing to cancel
Fix #380
Diffstat (limited to 'src/app/app.rs')
-rw-r--r-- | src/app/app.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/app/app.rs b/src/app/app.rs index 63a2274..9dbab9c 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -26,8 +26,6 @@ use { termimad::{Event, EventSource}, }; -const ESCAPE_TO_QUIT: bool = false; - #[cfg(feature = "client-server")] use std::sync::{Arc, Mutex}; @@ -419,7 +417,7 @@ impl App { if self.remove_state() { self.mut_state().refresh(app_cmd_context.screen, con); self.mut_panel().refresh_input_status(app_state, &app_cmd_context); - } else if ESCAPE_TO_QUIT { + } else if con.quit_on_last_cancel { self.quitting = true; } } @@ -437,7 +435,7 @@ impl App { con, }; self.mut_panel().apply_command(w, &cmd, app_state, &app_cmd_context)?; - } else if ESCAPE_TO_QUIT { + } else if con.quit_on_last_cancel { self.quitting = true; } } |