diff options
| author | soryu <soryu@soryu.co> | 2026-01-21 15:58:34 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-21 15:58:34 +0000 |
| commit | da246c4c4e23c9ad976705f9a3fa80e0d75b4425 (patch) | |
| tree | ddc3b93ed269e60dac1aa9113000daeac4a1b6e6 /makima/src/daemon/tui/event.rs | |
| parent | 7155e6cd7ddf25a5a4d4f6d6abecd49f0cf519dc (diff) | |
| download | soryu-da246c4c4e23c9ad976705f9a3fa80e0d75b4425.tar.gz soryu-da246c4c4e23c9ad976705f9a3fa80e0d75b4425.zip | |
Update CLI to show repo suggestions
Diffstat (limited to 'makima/src/daemon/tui/event.rs')
| -rw-r--r-- | makima/src/daemon/tui/event.rs | 24 |
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 |
