1
0
Fork 0

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`.
This commit is contained in:
Benedikt Peetz 2023-09-09 19:57:49 +02:00
parent 74f3b25827
commit 7aea23f3b6
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ pub async fn handle_command(
pub async fn handle_normal(app: &mut App<'_>, input_event: &CrosstermEvent) -> Result<EventStatus> { pub async fn handle_normal(app: &mut App<'_>, input_event: &CrosstermEvent) -> Result<EventStatus> {
match input_event { match input_event {
CrosstermEvent::Key(KeyEvent { CrosstermEvent::Key(KeyEvent {
code: KeyCode::Esc, .. code: KeyCode::Char('q'),
..
}) => { }) => {
app.tx app.tx
.send(Event::CommandEvent(Command::Exit, None)) .send(Event::CommandEvent(Command::Exit, None))