compiled, needs other fixes

This commit is contained in:
filipriec
2025-06-02 12:08:16 +02:00
parent 3488ab4f6b
commit 59ed52814e
5 changed files with 65 additions and 61 deletions

View File

@@ -489,6 +489,10 @@ impl EventHandler {
}
}
// Extracting values to avoid borrow conflicts
let mut current_position = form_state.current_position;
let total_count = form_state.total_count;
let (_should_exit, message) = read_only::handle_read_only_event(
app_state,
key_event,
@@ -499,8 +503,8 @@ impl EventHandler {
&mut admin_state.add_table_state,
&mut admin_state.add_logic_state,
&mut self.key_sequence_tracker,
form_state.current_position,
form_state.total_count,
&mut current_position,
total_count,
grpc_client,
&mut self.command_message,
&mut self.edit_mode_cooldown,
@@ -531,6 +535,10 @@ impl EventHandler {
return Ok(EventOutcome::Ok("".to_string()));
}
// Extracting values to avoid borrow conflicts
let mut current_position = form_state.current_position;
let total_count = form_state.total_count;
let (_should_exit, message) = read_only::handle_read_only_event(
app_state,
key_event,
@@ -541,8 +549,8 @@ impl EventHandler {
&mut admin_state.add_table_state,
&mut admin_state.add_logic_state,
&mut self.key_sequence_tracker,
form_state.current_position,
form_state.total_count,
&mut current_position,
total_count,
grpc_client,
&mut self.command_message,
&mut self.edit_mode_cooldown,
@@ -573,6 +581,10 @@ impl EventHandler {
}
}
// Extracting values to avoid borrow conflicts
let mut current_position = form_state.current_position;
let total_count = form_state.total_count;
let edit_result = edit::handle_edit_event(
key_event,
config,
@@ -581,6 +593,8 @@ impl EventHandler {
register_state,
admin_state,
&mut self.ideal_cursor_column,
&mut current_position,
total_count,
grpc_client,
app_state,
)
@@ -657,6 +671,11 @@ impl EventHandler {
}
if config.is_command_execute(key_code, modifiers) {
// Extracting values to avoid borrow conflicts
let mut current_position = form_state.current_position;
let total_count = form_state.total_count;
let outcome = command_mode::handle_command_event(
key_event,
config,
@@ -669,8 +688,14 @@ impl EventHandler {
grpc_client,
command_handler,
terminal,
&mut current_position,
total_count,
)
.await?;
// Update form_state with potentially changed position
form_state.current_position = current_position;
self.command_mode = false;
self.key_sequence_tracker.reset();
let new_mode = ModeManager::derive_mode(app_state, self, admin_state);