From 6d6df7ca5ca5aac35feda927c35a9bd9f82ffea1 Mon Sep 17 00:00:00 2001 From: filipriec Date: Sat, 12 Apr 2025 00:13:28 +0200 Subject: [PATCH] still not working autocomplete --- client/src/functions/modes/edit/auth_e.rs | 4 ++-- client/src/modes/canvas/edit.rs | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/functions/modes/edit/auth_e.rs b/client/src/functions/modes/edit/auth_e.rs index 7297b2a..86e2ceb 100644 --- a/client/src/functions/modes/edit/auth_e.rs +++ b/client/src/functions/modes/edit/auth_e.rs @@ -309,13 +309,13 @@ pub async fn execute_edit_action( let max_index = register_state.role_suggestions.len().saturating_sub(1); let current_index = register_state.selected_suggestion_index.unwrap_or(0); register_state.selected_suggestion_index = Some(if current_index >= max_index { 0 } else { current_index + 1 }); - Ok("Suggestion changed".to_string()) + Ok("Suggestion changed down".to_string()) } "suggestion_up" if register_state.show_role_suggestions => { let max_index = register_state.role_suggestions.len().saturating_sub(1); let current_index = register_state.selected_suggestion_index.unwrap_or(0); register_state.selected_suggestion_index = Some(if current_index == 0 { max_index } else { current_index.saturating_sub(1) }); - Ok("Suggestion changed".to_string()) + Ok("Suggestion changed up".to_string()) } "select_suggestion" if register_state.show_role_suggestions => { if let Some(selected_index) = register_state.selected_suggestion_index { diff --git a/client/src/modes/canvas/edit.rs b/client/src/modes/canvas/edit.rs index f24c162..94cb622 100644 --- a/client/src/modes/canvas/edit.rs +++ b/client/src/modes/canvas/edit.rs @@ -115,9 +115,7 @@ pub async fn handle_edit_event( // Character insertion if let KeyCode::Char(_) = key.code { - // --- Autocomplete Trigger on Char Insert --- let is_role_field = app_state.ui.show_register && register_state.current_field() == 4; - let result = // Store result before potential update // --- End Autocomplete Trigger --- return if app_state.ui.show_login { @@ -156,7 +154,6 @@ pub async fn handle_edit_event( if is_role_field { register_state.update_role_suggestions(); } - return result; // Return the result from execute_edit_action } // Handle Backspace/Delete for Autocomplete Trigger