From ffd45ad9ad761f611b6b3b6c555f83ac752a86f5 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Tue, 28 May 2024 21:23:02 +0100 Subject: [PATCH] hotfix: do not try to navigate the list when editing --- src/handler.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index 7713490..45f7a26 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -40,12 +40,14 @@ pub async fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult< } } } - match key_event.code { - Char('j') | Down => app.list.next(), - Char('k') | Up => app.list.previous(), - Char('g') => app.go_top(), - Char('G') => app.go_bottom(), - _ => {} + if app.editing != true { + match key_event.code { + Char('j') | Down => app.list.next(), + Char('k') | Up => app.list.previous(), + Char('g') => app.go_top(), + Char('G') => app.go_bottom(), + _ => {} + } } Ok(()) }