diff options
author | Joris | 2022-09-12 08:47:20 +0200 |
---|---|---|
committer | Joris | 2022-09-12 08:47:20 +0200 |
commit | f12e337cd88dfa34035e73facd06c061f1d7ac11 (patch) | |
tree | bd38fd8330ea97409eafcc9c88499d4309877e31 /src | |
parent | 11984f74c5785562a4aff210f50fd75dc3a97cb8 (diff) |
React to C-u and C-w keys
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/question.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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<B: Backend>( Key::Backspace => { state.input.pop(); } + Key::Ctrl('u') => { + state.input.clear(); + } + Key::Ctrl('w') => { + let mut words = state.input.split_whitespace().collect::<Vec<&str>>(); + words.truncate(words.len() - 1); + state.input = words.join(" "); + } _ => {} }, Answer::Difficulty { |