keyfork-prompt: allow delete-word
This commit is contained in:
parent
6c25cb8f31
commit
1cdbab1a1d
|
@ -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(' ');
|
||||
|
|
Loading…
Reference in New Issue