summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-04-18 21:31:12 +0200
committerandromeda <andromeda@lenovo>2026-04-18 21:31:12 +0200
commitbcd83506ea691861562ade66ce23f57b27e57ee2 (patch)
tree180eda9613ea360175252c344489d1eb2f45ea20
parent219930f3c649a3712864c2e00ebf630279beda72 (diff)
allow undo with 'u'
-rw-r--r--src/main.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 15e12dc..69a10cd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -86,6 +86,11 @@ fn prompt(anki: &AnkiClient) {
match event::read().unwrap() {
Event::Key(e) => match e.code {
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 {
KeyCode::Char(AGAIN) => break Ease::Again,
KeyCode::Char(GOOD) => break Ease::Good,
+ KeyCode::Char('u') => {
+ anki.request(GuiUndoRequest {}).unwrap();
+ event::read().unwrap();
+ return;
+ }
_ => (),
},
_ => (),