mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 12:05:34 +00:00
parent
557686e197
commit
12fdf94e5d
@ -10,6 +10,9 @@ pub enum Action {
|
|||||||
/// Delete the character before the cursor from the input buffer.
|
/// Delete the character before the cursor from the input buffer.
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
DeletePrevChar,
|
DeletePrevChar,
|
||||||
|
/// Delete the previous word from the input buffer.
|
||||||
|
#[serde(skip)]
|
||||||
|
DeletePrevWord,
|
||||||
/// Delete the character after the cursor from the input buffer.
|
/// Delete the character after the cursor from the input buffer.
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
DeleteNextChar,
|
DeleteNextChar,
|
||||||
|
@ -195,6 +195,7 @@ impl App {
|
|||||||
// text input events
|
// text input events
|
||||||
match keycode {
|
match keycode {
|
||||||
Key::Backspace => return Action::DeletePrevChar,
|
Key::Backspace => return Action::DeletePrevChar,
|
||||||
|
Key::Ctrl('w') => return Action::DeletePrevWord,
|
||||||
Key::Delete => return Action::DeleteNextChar,
|
Key::Delete => return Action::DeleteNextChar,
|
||||||
Key::Left => return Action::GoToPrevChar,
|
Key::Left => return Action::GoToPrevChar,
|
||||||
Key::Right => return Action::GoToNextChar,
|
Key::Right => return Action::GoToNextChar,
|
||||||
|
@ -7,6 +7,7 @@ pub fn convert_action_to_input_request(
|
|||||||
match action {
|
match action {
|
||||||
Action::AddInputChar(c) => Some(InputRequest::InsertChar(*c)),
|
Action::AddInputChar(c) => Some(InputRequest::InsertChar(*c)),
|
||||||
Action::DeletePrevChar => Some(InputRequest::DeletePrevChar),
|
Action::DeletePrevChar => Some(InputRequest::DeletePrevChar),
|
||||||
|
Action::DeletePrevWord => Some(InputRequest::DeletePrevWord),
|
||||||
Action::DeleteNextChar => Some(InputRequest::DeleteNextChar),
|
Action::DeleteNextChar => Some(InputRequest::DeleteNextChar),
|
||||||
Action::GoToPrevChar => Some(InputRequest::GoToPrevChar),
|
Action::GoToPrevChar => Some(InputRequest::GoToPrevChar),
|
||||||
Action::GoToNextChar => Some(InputRequest::GoToNextChar),
|
Action::GoToNextChar => Some(InputRequest::GoToNextChar),
|
||||||
|
@ -264,6 +264,7 @@ impl Television {
|
|||||||
// handle input actions
|
// handle input actions
|
||||||
Action::AddInputChar(_)
|
Action::AddInputChar(_)
|
||||||
| Action::DeletePrevChar
|
| Action::DeletePrevChar
|
||||||
|
| Action::DeletePrevWord
|
||||||
| Action::DeleteNextChar
|
| Action::DeleteNextChar
|
||||||
| Action::GoToInputEnd
|
| Action::GoToInputEnd
|
||||||
| Action::GoToInputStart
|
| Action::GoToInputStart
|
||||||
|
Loading…
x
Reference in New Issue
Block a user