InputBehavior

Trait InputBehavior 

Source
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§

Source

fn buffer_manager(&mut self) -> &mut BufferManager

Source

fn cursor_manager(&mut self) -> &mut CursorManager

Source

fn set_input_text_with_cursor(&mut self, text: String, cursor: usize)

Source

fn state_container(&self) -> &AppStateContainer

Source

fn state_container_mut(&mut self) -> &mut AppStateContainer

Source

fn buffer_mut(&mut self) -> &mut dyn BufferAPI

Source

fn set_mode_with_sync(&mut self, mode: AppMode, trigger: &str)

Provided Methods§

Source

fn get_current_input(&mut self) -> (String, usize)

Source

fn apply_text_result(&mut self, result: TextOperationResult)

Source

fn apply_cursor_result(&mut self, result: CursorMovementResult)

Source

fn kill_line(&mut self)

Kill text from cursor to end of line (Ctrl+K)

Source

fn kill_line_backward(&mut self)

Kill text from beginning of line to cursor (Ctrl+U)

Source

fn delete_word_backward(&mut self)

Delete word backward from cursor (Ctrl+W)

Source

fn delete_word_forward(&mut self)

Delete word forward from cursor (Alt+D)

Source

fn move_cursor_word_backward(&mut self)

Move cursor backward one word (Ctrl+Left or Alt+B)

Source

fn move_cursor_word_forward(&mut self)

Move cursor forward one word (Ctrl+Right or Alt+F)

Source

fn jump_to_prev_token(&mut self)

Jump to previous SQL token (Alt+[)

Source

fn jump_to_next_token(&mut self)

Jump to next SQL token (Alt+])

Source

fn insert_char(&mut self, ch: char)

Insert a character at the cursor position

Source

fn delete_char(&mut self)

Delete character at cursor position (Delete key)

Source

fn backspace(&mut self)

Delete character before cursor (Backspace)

Source

fn clear_input(&mut self)

Clear all input text

Source

fn get_jump_to_row_input(&self) -> String

Get jump-to-row input text

Source

fn set_jump_to_row_input(&mut self, input: String)

Set jump-to-row input text

Source

fn clear_jump_to_row_input(&mut self)

Clear jump-to-row input

Source

fn process_jump_to_row_key(&mut self, key: KeyEvent) -> bool

Process jump-to-row input key event (handles all keys except Enter)

Implementors§