From 7aea23f3b650820453970a625b92626f72042a34 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 9 Sep 2023 19:57:49 +0200 Subject: [PATCH] fix(handlers/main)!: Change exit key to `q` `Esc` is bound to exit a deeper mode (like `insert` or `command`) and return to `normal` mode. This however is rather inconvenient, when `Esc` also exits Trinitrix in general, as spamming `Esc` then becomes impossible. This changes also puts Trinitrix more in line with vim (although vim does not allow exiting with `q`). BREAKING CHANGE: To exit press `q` instead of `Esc`. --- src/app/events/event_types/event/handlers/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/events/event_types/event/handlers/main.rs b/src/app/events/event_types/event/handlers/main.rs index 710050b..8822502 100644 --- a/src/app/events/event_types/event/handlers/main.rs +++ b/src/app/events/event_types/event/handlers/main.rs @@ -58,7 +58,8 @@ pub async fn handle_command( pub async fn handle_normal(app: &mut App<'_>, input_event: &CrosstermEvent) -> Result { match input_event { CrosstermEvent::Key(KeyEvent { - code: KeyCode::Esc, .. + code: KeyCode::Char('q'), + .. }) => { app.tx .send(Event::CommandEvent(Command::Exit, None))