diff --git a/client/src/modes/handlers/edit.rs b/client/src/modes/handlers/edit.rs index d04e078..09d587b 100644 --- a/client/src/modes/handlers/edit.rs +++ b/client/src/modes/handlers/edit.rs @@ -24,6 +24,18 @@ pub async fn handle_edit_event_internal( handle_edit_specific_input(key, form_state, ideal_cursor_column); return Ok(command_message.clone()); } + + // Check common actions first + if let Some(action) = config.get_action_for_key_in_mode(&config.keybindings.common, key.code, key.modifiers) { + return execute_common_action( + action, + form_state, + grpc_client, + current_position, + total_count, + ).await; + } + if let Some(action) = config.get_edit_action_for_key(key.code, key.modifiers) { return execute_edit_action( action, @@ -45,6 +57,27 @@ pub async fn handle_edit_event_internal( Ok(command_message.clone()) } +async fn execute_common_action( + action: &str, + form_state: &mut FormState, + grpc_client: &mut GrpcClient, + current_position: &mut u64, + total_count: u64, +) -> Result> { + match action { + "revert" => { + common::revert( + form_state, + grpc_client, + current_position, + total_count, + ).await + } + // Add other common actions here if needed + _ => Ok(format!("Common action not handled: {}", action)), + } +} + fn handle_edit_specific_input( key: KeyEvent, form_state: &mut FormState,