From 765ba94cdd65184bd4b443c3a946d0d96dc805d6 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 26 Nov 2022 16:00:38 +0100 Subject: Go to evaluation if answer is correct when typing Don’t require to press Enter when the answer is correct. --- src/gui/question.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/question.rs b/src/gui/question.rs index 426daa9..71c3ea2 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -149,6 +149,9 @@ pub fn ask( } Key::Char(c) => { state.input.push(c); + if is_correct(&state.input, &card.responses) { + state.answer = Answer::Difficulty { difficulty: Difficulty::Good } + } } Key::Backspace => { state.input.pop(); -- cgit v1.2.3