From f12e337cd88dfa34035e73facd06c061f1d7ac11 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 12 Sep 2022 08:47:20 +0200 Subject: React to C-u and C-w keys --- src/gui/question.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui') diff --git a/src/gui/question.rs b/src/gui/question.rs index 55c099d..81347b5 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -144,6 +144,14 @@ pub fn ask( Key::Backspace => { state.input.pop(); } + Key::Ctrl('u') => { + state.input.clear(); + } + Key::Ctrl('w') => { + let mut words = state.input.split_whitespace().collect::>(); + words.truncate(words.len() - 1); + state.input = words.join(" "); + } _ => {} }, Answer::Difficulty { -- cgit v1.2.3