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::{
|
use crossterm::{
|
||||||
cursor,
|
cursor,
|
||||||
event::{read, Event, KeyCode},
|
event::{read, Event, KeyCode, KeyModifiers},
|
||||||
style::{Print, PrintStyledContent, Stylize},
|
style::{Print, PrintStyledContent, Stylize},
|
||||||
terminal,
|
terminal,
|
||||||
tty::IsTty,
|
tty::IsTty,
|
||||||
|
@ -110,6 +110,9 @@ where
|
||||||
KeyCode::Backspace => {
|
KeyCode::Backspace => {
|
||||||
input.pop();
|
input.pop();
|
||||||
}
|
}
|
||||||
|
KeyCode::Char('w') if k.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||||
|
while input.pop().is_some_and(|c| !c.is_whitespace()) {}
|
||||||
|
}
|
||||||
KeyCode::Char(' ') => {
|
KeyCode::Char(' ') => {
|
||||||
if !input.chars().rev().next().is_some_and(char::is_whitespace) {
|
if !input.chars().rev().next().is_some_and(char::is_whitespace) {
|
||||||
input.push(' ');
|
input.push(' ');
|
||||||
|
|
Loading…
Reference in New Issue