diff --git a/keyfork-prompt/src/lib.rs b/keyfork-prompt/src/lib.rs index 4669cc6..1fed38b 100644 --- a/keyfork-prompt/src/lib.rs +++ b/keyfork-prompt/src/lib.rs @@ -8,7 +8,7 @@ use keyfork_mnemonic_util::Wordlist; use crossterm::{ cursor, - event::{read, Event, KeyCode}, + event::{read, Event, KeyCode, KeyModifiers}, style::{Print, PrintStyledContent, Stylize}, terminal, tty::IsTty, @@ -110,6 +110,9 @@ where KeyCode::Backspace => { input.pop(); } + KeyCode::Char('w') if k.modifiers.contains(KeyModifiers::CONTROL) => { + while input.pop().is_some_and(|c| !c.is_whitespace()) {} + } KeyCode::Char(' ') => { if !input.chars().rev().next().is_some_and(char::is_whitespace) { input.push(' ');