Skip to content

Commit

Permalink
Fix quick completion (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibon7 authored Jan 29, 2024
1 parent 090af4d commit a5d3c35
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,17 @@ impl Reedline {
}
Ok(EventStatus::Inapplicable)
}
ReedlineEvent::MenuNext => {
self.active_menu()
.map_or(Ok(EventStatus::Inapplicable), |menu| {
ReedlineEvent::MenuNext => match self.active_menu() {
None => Ok(EventStatus::Inapplicable),
Some(menu) => {
if menu.get_values().len() == 1 && menu.can_quick_complete() {
self.handle_editor_event(prompt, ReedlineEvent::Enter)
} else {
menu.menu_event(MenuEvent::NextElement);
Ok(EventStatus::Handled)
})
}
}
}
},
ReedlineEvent::MenuPrevious => {
self.active_menu()
.map_or(Ok(EventStatus::Inapplicable), |menu| {
Expand Down

0 comments on commit a5d3c35

Please sign in to comment.