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