merge checks for single hint

This commit is contained in:
Simon Gardling 2022-04-12 10:06:15 -04:00
parent 2e0569fe2e
commit d2298e69a2
2 changed files with 5 additions and 7 deletions

View File

@ -72,6 +72,7 @@ impl<'a> HintEnum<'a> {
#[allow(dead_code)]
pub fn is_some(&self) -> bool { !self.is_none() }
#[allow(dead_code)]
pub fn is_single(&self) -> bool {
match self {
HintEnum::Single(_) => true,

View File

@ -112,13 +112,6 @@ impl<'a> AutoComplete<'a> {
if let HintEnum::Single(single_hint) = self.hint {
func_edit = func_edit.hint_text(*single_hint);
}
let re = func_edit.ui(ui);
self.update(&new_string);
if !self.hint.is_single() {
if ui.input().key_pressed(Key::ArrowDown) {
movement = Movement::Down;
} else if ui.input().key_pressed(Key::ArrowUp) {
@ -126,6 +119,10 @@ impl<'a> AutoComplete<'a> {
}
}
let re = func_edit.ui(ui);
self.update(&new_string);
self.interact_back(&movement);
if movement != Movement::Complete && let HintEnum::Many(hints) = self.hint {