summaryrefslogtreecommitdiff
path: root/makima/src/daemon/tui/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/tui/event.rs')
-rw-r--r--makima/src/daemon/tui/event.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/makima/src/daemon/tui/event.rs b/makima/src/daemon/tui/event.rs
index 2fed55a..d5ca569 100644
--- a/makima/src/daemon/tui/event.rs
+++ b/makima/src/daemon/tui/event.rs
@@ -194,6 +194,30 @@ fn handle_create_mode(app: &App, key: KeyEvent) -> Action {
}
let current_field = app.create_state.current_field();
+ let has_suggestions = app.create_state.show_suggestions
+ && !app.create_state.repo_suggestions.is_empty();
+
+ // Allow Ctrl+N/Ctrl+P to navigate suggestions from any field
+ if has_suggestions && key.modifiers.contains(KeyModifiers::CONTROL) {
+ match key.code {
+ KeyCode::Char('n') => return Action::CreateNextSuggestion,
+ KeyCode::Char('p') => return Action::CreatePrevSuggestion,
+ _ => {}
+ }
+ }
+
+ // Special handling when on Repository field with suggestions visible
+ let on_repo_field = current_field == CreateFormField::Repository;
+ if has_suggestions && on_repo_field {
+ match key.code {
+ // Up/Down navigate suggestions when on repo field
+ KeyCode::Up => return Action::CreatePrevSuggestion,
+ KeyCode::Down => return Action::CreateNextSuggestion,
+ // Enter applies suggestion instead of submitting form
+ KeyCode::Enter => return Action::CreateApplySuggestion,
+ _ => {}
+ }
+ }
match key.code {
// Submit form