tab is triggering the suggestion dropdown menu, but ctrl+n and ctrl+p only cycle through it

This commit is contained in:
filipriec
2025-04-12 23:56:14 +02:00
parent 149949ad99
commit 5e101bef14
4 changed files with 26 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ use crate::{
components::common::{dialog, autocomplete},
state::state::AppState,
state::canvas_state::CanvasState,
modes::handlers::mode_manager::AppMode,
};
use ratatui::{
layout::{Alignment, Constraint, Direction, Layout, Rect, Margin},
@@ -136,11 +137,13 @@ pub fn render_register(
);
// --- Render Autocomplete Dropdown (Draw AFTER buttons) ---
if let Some(suggestions) = state.get_suggestions() {
let selected = state.get_selected_suggestion_index();
if !suggestions.is_empty() {
if let Some(input_rect) = active_field_rect {
autocomplete::render_autocomplete_dropdown(f, input_rect, f.size(), theme, suggestions, selected);
if app_state.current_mode == AppMode::Edit {
if let Some(suggestions) = state.get_suggestions() {
let selected = state.get_selected_suggestion_index();
if !suggestions.is_empty() {
if let Some(input_rect) = active_field_rect {
autocomplete::render_autocomplete_dropdown(f, input_rect, f.size(), theme, suggestions, selected);
}
}
}
}