aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2022-11-26 16:00:38 +0100
committerJoris2022-11-26 16:00:38 +0100
commit765ba94cdd65184bd4b443c3a946d0d96dc805d6 (patch)
tree9f06d716714aecd946d6371344bf362f94093ae5
parentf1b134f51254e82f352a06aae9557cc4570627de (diff)
Go to evaluation if answer is correct when typing
Don’t require to press Enter when the answer is correct.
-rw-r--r--src/gui/question.rs3
1 files changed, 3 insertions, 0 deletions
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<B: Backend>(
}
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();