diff options
author | Joris | 2022-11-26 16:00:38 +0100 |
---|---|---|
committer | Joris | 2022-11-26 16:00:38 +0100 |
commit | 765ba94cdd65184bd4b443c3a946d0d96dc805d6 (patch) | |
tree | 9f06d716714aecd946d6371344bf362f94093ae5 /src/gui | |
parent | f1b134f51254e82f352a06aae9557cc4570627de (diff) |
Go to evaluation if answer is correct when typing
Don’t require to press Enter when the answer is correct.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/question.rs | 3 |
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(); |