enter decider should be taken care of next, suggestions works in register now also
This commit is contained in:
@@ -74,7 +74,7 @@ move_left = [""]
|
||||
move_right = ["right"]
|
||||
suggestion_down = ["ctrl+n", "tab"]
|
||||
suggestion_up = ["ctrl+p", "shift+tab"]
|
||||
trigger_autocomplete = ["tab"]
|
||||
trigger_autocomplete = ["left"]
|
||||
|
||||
[keybindings.command]
|
||||
exit_command_mode = ["ctrl+g", "esc"]
|
||||
|
||||
@@ -291,6 +291,28 @@ pub async fn execute_edit_action<S: CanvasState + Any + Send>(
|
||||
Ok("Moved to previous word end".to_string())
|
||||
}
|
||||
|
||||
"trigger_autocomplete" => {
|
||||
if let Some(register_state) = (state as &mut dyn Any).downcast_mut::<RegisterState>() {
|
||||
if register_state.current_field() == 4 { // Role field
|
||||
register_state.update_role_suggestions();
|
||||
|
||||
if !register_state.role_suggestions.is_empty() {
|
||||
register_state.in_suggestion_mode = true;
|
||||
register_state.show_role_suggestions = true;
|
||||
register_state.selected_suggestion_index = Some(0);
|
||||
|
||||
return Ok("Autocomplete activated".to_string());
|
||||
} else {
|
||||
return Ok("No suggestions available".to_string());
|
||||
}
|
||||
} else {
|
||||
return Ok("Autocomplete only available on role field".to_string());
|
||||
}
|
||||
} else {
|
||||
return Ok("Autocomplete not supported for this state".to_string());
|
||||
}
|
||||
}
|
||||
|
||||
// --- Autocomplete Actions ---
|
||||
"suggestion_down" | "suggestion_up" | "select_suggestion" | "exit_suggestion_mode" => {
|
||||
// Attempt to downcast to RegisterState to handle suggestion logic here
|
||||
|
||||
Reference in New Issue
Block a user