From 3775cd88a3f6f6393f59039bb6ce0664378a7543 Mon Sep 17 00:00:00 2001 From: jooaf Date: Wed, 9 Apr 2025 22:31:17 -0500 Subject: [PATCH] Fix: Handling 'j' and 'k' in edit mode --- Cargo.lock | 2 +- src/ui_handler.rs | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0933f09..9739106 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1427,7 +1427,7 @@ dependencies = [ [[package]] name = "thoth-cli" -version = "0.1.78" +version = "0.1.79" dependencies = [ "anyhow", "arboard", diff --git a/src/ui_handler.rs b/src/ui_handler.rs index 0596a52..7e65266 100644 --- a/src/ui_handler.rs +++ b/src/ui_handler.rs @@ -163,20 +163,6 @@ fn handle_full_screen_input(state: &mut UIState, key: event::KeyEvent) -> Result state.scrollable_textarea.handle_scroll(1); } } - KeyCode::Char('k') => { - if state.scrollable_textarea.edit_mode { - handle_up_key(state, key); - } else { - state.scrollable_textarea.handle_scroll(-1); - } - } - KeyCode::Char('j') => { - if state.scrollable_textarea.edit_mode { - handle_down_key(state, key); - } else { - state.scrollable_textarea.handle_scroll(1); - } - } KeyCode::Char('y') if key.modifiers.contains(KeyModifiers::CONTROL) => { match state.scrollable_textarea.copy_focused_textarea_contents() { Ok(_) => { @@ -466,8 +452,8 @@ fn handle_normal_input( } KeyCode::Up => handle_up_key(state, key), KeyCode::Down => handle_down_key(state, key), - KeyCode::Char('k') => handle_up_key(state, key), - KeyCode::Char('j') => handle_down_key(state, key), + KeyCode::Char('k') if !state.scrollable_textarea.edit_mode => handle_up_key(state, key), + KeyCode::Char('j') if !state.scrollable_textarea.edit_mode => handle_down_key(state, key), _ => { if state.scrollable_textarea.edit_mode { state.scrollable_textarea.textareas[state.scrollable_textarea.focused_index]