allow undo with 'u'

This commit is contained in:
andromeda
2026-04-18 21:31:12 +02:00
parent 219930f3c6
commit bcd83506ea

View File

@@ -86,6 +86,11 @@ fn prompt(anki: &AnkiClient) {
match event::read().unwrap() { match event::read().unwrap() {
Event::Key(e) => match e.code { Event::Key(e) => match e.code {
KeyCode::Enter => break, KeyCode::Enter => break,
KeyCode::Char('u') => {
anki.request(GuiUndoRequest {}).unwrap();
event::read().unwrap();
return;
}
_ => (), _ => (),
}, },
_ => (), _ => (),
@@ -104,6 +109,11 @@ fn prompt(anki: &AnkiClient) {
Event::Key(e) => match e.code { Event::Key(e) => match e.code {
KeyCode::Char(AGAIN) => break Ease::Again, KeyCode::Char(AGAIN) => break Ease::Again,
KeyCode::Char(GOOD) => break Ease::Good, KeyCode::Char(GOOD) => break Ease::Good,
KeyCode::Char('u') => {
anki.request(GuiUndoRequest {}).unwrap();
event::read().unwrap();
return;
}
_ => (), _ => (),
}, },
_ => (), _ => (),