pub trait InputBehavior {
Show 26 methods
// Required methods
fn buffer_manager(&mut self) -> &mut BufferManager;
fn cursor_manager(&mut self) -> &mut CursorManager;
fn set_input_text_with_cursor(&mut self, text: String, cursor: usize);
fn state_container(&self) -> &AppStateContainer;
fn state_container_mut(&mut self) -> &mut AppStateContainer;
fn buffer_mut(&mut self) -> &mut dyn BufferAPI;
fn set_mode_with_sync(&mut self, mode: AppMode, trigger: &str);
// Provided methods
fn get_current_input(&mut self) -> (String, usize) { ... }
fn apply_text_result(&mut self, result: TextOperationResult) { ... }
fn apply_cursor_result(&mut self, result: CursorMovementResult) { ... }
fn kill_line(&mut self) { ... }
fn kill_line_backward(&mut self) { ... }
fn delete_word_backward(&mut self) { ... }
fn delete_word_forward(&mut self) { ... }
fn move_cursor_word_backward(&mut self) { ... }
fn move_cursor_word_forward(&mut self) { ... }
fn jump_to_prev_token(&mut self) { ... }
fn jump_to_next_token(&mut self) { ... }
fn insert_char(&mut self, ch: char) { ... }
fn delete_char(&mut self) { ... }
fn backspace(&mut self) { ... }
fn clear_input(&mut self) { ... }
fn get_jump_to_row_input(&self) -> String { ... }
fn set_jump_to_row_input(&mut self, input: String) { ... }
fn clear_jump_to_row_input(&mut self) { ... }
fn process_jump_to_row_key(&mut self, key: KeyEvent) -> bool { ... }
}
Expand description
Trait that provides input operation behavior for TUI components This uses pure text manipulation functions and applies results to TUI state
Required Methods§
fn buffer_manager(&mut self) -> &mut BufferManager
fn cursor_manager(&mut self) -> &mut CursorManager
fn set_input_text_with_cursor(&mut self, text: String, cursor: usize)
fn state_container(&self) -> &AppStateContainer
fn state_container_mut(&mut self) -> &mut AppStateContainer
fn buffer_mut(&mut self) -> &mut dyn BufferAPI
fn set_mode_with_sync(&mut self, mode: AppMode, trigger: &str)
Provided Methods§
fn get_current_input(&mut self) -> (String, usize)
fn apply_text_result(&mut self, result: TextOperationResult)
fn apply_cursor_result(&mut self, result: CursorMovementResult)
Sourcefn kill_line_backward(&mut self)
fn kill_line_backward(&mut self)
Kill text from beginning of line to cursor (Ctrl+U)
Sourcefn delete_word_backward(&mut self)
fn delete_word_backward(&mut self)
Delete word backward from cursor (Ctrl+W)
Sourcefn delete_word_forward(&mut self)
fn delete_word_forward(&mut self)
Delete word forward from cursor (Alt+D)
Sourcefn move_cursor_word_backward(&mut self)
fn move_cursor_word_backward(&mut self)
Move cursor backward one word (Ctrl+Left or Alt+B)
Sourcefn move_cursor_word_forward(&mut self)
fn move_cursor_word_forward(&mut self)
Move cursor forward one word (Ctrl+Right or Alt+F)
Sourcefn jump_to_prev_token(&mut self)
fn jump_to_prev_token(&mut self)
Jump to previous SQL token (Alt+[)
Sourcefn jump_to_next_token(&mut self)
fn jump_to_next_token(&mut self)
Jump to next SQL token (Alt+])
Sourcefn insert_char(&mut self, ch: char)
fn insert_char(&mut self, ch: char)
Insert a character at the cursor position
Sourcefn delete_char(&mut self)
fn delete_char(&mut self)
Delete character at cursor position (Delete key)
Sourcefn clear_input(&mut self)
fn clear_input(&mut self)
Clear all input text
Sourcefn get_jump_to_row_input(&self) -> String
fn get_jump_to_row_input(&self) -> String
Get jump-to-row input text
Sourcefn set_jump_to_row_input(&mut self, input: String)
fn set_jump_to_row_input(&mut self, input: String)
Set jump-to-row input text
Sourcefn clear_jump_to_row_input(&mut self)
fn clear_jump_to_row_input(&mut self)
Clear jump-to-row input
Sourcefn process_jump_to_row_key(&mut self, key: KeyEvent) -> bool
fn process_jump_to_row_key(&mut self, key: KeyEvent) -> bool
Process jump-to-row input key event (handles all keys except Enter)